diff --git a/lua/gpm/init.lua b/lua/gpm/init.lua index d0ce42c0..d8d6a344 100644 --- a/lua/gpm/init.lua +++ b/lua/gpm/init.lua @@ -24,7 +24,7 @@ MsgN( [[ module( "gpm", package.seeall ) -_VERSION = 012700 +_VERSION = 012701 if not Colors then Colors = { diff --git a/lua/gpm/sources/lua.lua b/lua/gpm/sources/lua.lua index dcb3218f..afa8a3ca 100644 --- a/lua/gpm/sources/lua.lua +++ b/lua/gpm/sources/lua.lua @@ -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 @@ -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