Fix for files getting run twice by (use "")
This commit is contained in:
parent
3036d425a5
commit
17fc0a0e38
@ -322,18 +322,30 @@ local nomsu_environment = Importer({
|
||||
break
|
||||
end
|
||||
for _index_0 = 1, #files do
|
||||
local filename = files[_index_0]
|
||||
local lua_filename = filename:gsub("%.nom$", ".lua")
|
||||
local code
|
||||
if optimization ~= 0 and Files.read(lua_filename) then
|
||||
local file = Files.read(lua_filename)
|
||||
code = LuaCode:from(Source(filename, 1, #file), file)
|
||||
else
|
||||
local file = Files.read(filename)
|
||||
code = NomsuCode:from(Source(filename, 1, #file), file)
|
||||
local _continue_1 = false
|
||||
repeat
|
||||
local filename = files[_index_0]
|
||||
local lua_filename = filename:gsub("%.nom$", ".lua")
|
||||
if environment.FILE_CACHE[filename] then
|
||||
import_to_1_from(environment, environment.FILE_CACHE[filename], prefix)
|
||||
_continue_1 = true
|
||||
break
|
||||
end
|
||||
local code
|
||||
if optimization ~= 0 and Files.read(lua_filename) then
|
||||
local file = Files.read(lua_filename)
|
||||
code = LuaCode:from(Source(filename, 1, #file), file)
|
||||
else
|
||||
local file = Files.read(filename)
|
||||
code = NomsuCode:from(Source(filename, 1, #file), file)
|
||||
end
|
||||
environment.run_1_in(code, mod)
|
||||
did_anything = true
|
||||
_continue_1 = true
|
||||
until true
|
||||
if not _continue_1 then
|
||||
break
|
||||
end
|
||||
environment.run_1_in(code, mod)
|
||||
did_anything = true
|
||||
end
|
||||
break
|
||||
end
|
||||
|
@ -179,6 +179,10 @@ nomsu_environment = Importer{
|
||||
continue unless files
|
||||
for filename in *files
|
||||
lua_filename = filename\gsub("%.nom$", ".lua")
|
||||
-- Need to check here to prevent re-running files
|
||||
if environment.FILE_CACHE[filename]
|
||||
import_to_1_from(environment, environment.FILE_CACHE[filename], prefix)
|
||||
continue
|
||||
-- TODO: don't automatically use precompiled version?
|
||||
code = if optimization != 0 and Files.read(lua_filename)
|
||||
-- TODO: use a checksum?
|
||||
|
Loading…
Reference in New Issue
Block a user