mirror of
https://github.com/leafo/moonscript.git
synced 2025-01-09 00:04:22 +00:00
Stopped swallowing errors in moonloader.
This commit is contained in:
parent
ce3d4adbb1
commit
f49e88b470
@ -56,10 +56,13 @@ moon_loader = function(name)
|
|||||||
if file then
|
if file then
|
||||||
local text = file:read("*a")
|
local text = file:read("*a")
|
||||||
file:close()
|
file:close()
|
||||||
return loadstring(text, file_path)
|
local res, err = loadstring(text, file_path)
|
||||||
else
|
if not res then
|
||||||
return nil, "Could not find moon file"
|
error(err)
|
||||||
end
|
end
|
||||||
|
return res
|
||||||
|
end
|
||||||
|
return nil, "Could not find moon file"
|
||||||
end
|
end
|
||||||
if not package.moonpath then
|
if not package.moonpath then
|
||||||
package.moonpath = create_moonpath(package.path)
|
package.moonpath = create_moonpath(package.path)
|
||||||
|
@ -47,9 +47,13 @@ moon_loader = (name) ->
|
|||||||
if file
|
if file
|
||||||
text = file\read "*a"
|
text = file\read "*a"
|
||||||
file\close!
|
file\close!
|
||||||
loadstring text, file_path
|
res, err = loadstring text, file_path
|
||||||
else
|
if not res
|
||||||
nil, "Could not find moon file"
|
error err
|
||||||
|
|
||||||
|
return res
|
||||||
|
|
||||||
|
return nil, "Could not find moon file"
|
||||||
|
|
||||||
if not package.moonpath
|
if not package.moonpath
|
||||||
package.moonpath = create_moonpath package.path
|
package.moonpath = create_moonpath package.path
|
||||||
|
Loading…
Reference in New Issue
Block a user