Skip to content

Commit

Permalink
Patch1
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown-gd committed May 25, 2023
1 parent 05c4291 commit a77a563
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lua/gpm/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ MsgN( [[

module( "gpm", package.seeall )

_VERSION = 012700
_VERSION = 012701

if not Colors then
Colors = {
Expand Down
6 changes: 4 additions & 2 deletions lua/gpm/sources/lua.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ end
GetMetadata = promise.Async( function( importPath )
local metadata, folder = nil, importPath
if fs.IsDir( folder, luaRealm ) then
moonloader.PreCacheDir( folder )
if moonloader ~= nil then
moonloader.PreCacheDir( folder )
end
else
folder = string.GetPathFromFilename( importPath )
end
Expand All @@ -57,7 +59,7 @@ GetMetadata = promise.Async( function( importPath )
}

if fs.IsFile( importPath, luaRealm ) then
if string.EndsWith( importPath, ".moon" ) and not moonloader.PreCacheFile( importPath ) then
if string.EndsWith( importPath, ".moon" ) and moonloader ~= nil and not moonloader.PreCacheFile( importPath ) then
return promise.Reject( "Compiling Moonscript file '" .. importPath .. "' into Lua is failed!" )
end

Expand Down

0 comments on commit a77a563

Please sign in to comment.