Update embed.lua

This commit is contained in:
Tom van Dijck 2017-08-07 08:52:18 -07:00 committed by GitHub
parent 9f33db3ba7
commit 133856c0ef

View File

@ -69,22 +69,20 @@
if not data then
if not path.hasextension(filename, ".lua") then
data = loadScript(filename)
else
if _OPTIONS["bytecode"] then
verbosef("Compiling... " .. filename)
local output = path.replaceextension(filename, ".luac")
local res, err = os.compile(filename, output);
if res ~= nil then
data = loadScript(output)
os.remove(output)
else
print(err)
print("Embedding source instead.")
data = stripScript(loadScript(filename))
end
elseif _OPTIONS["bytecode"] then
verbosef("Compiling... " .. filename)
local output = path.replaceextension(filename, ".luac")
local res, err = os.compile(filename, output);
if res ~= nil then
data = loadScript(output)
os.remove(output)
else
print(err)
print("Embedding source instead.")
data = stripScript(loadScript(filename))
end
else
data = stripScript(loadScript(filename))
end
end