Merge branch 'develop' of https://github.com/DFHack/dfhack into develop

develop
Japa 2016-10-19 20:01:25 +05:30
commit e3f8d63726
3 changed files with 8 additions and 8 deletions

@ -543,23 +543,23 @@ function dfhack.run_script_with_env(envVars, name, flags, ...)
end end
env.dfhack_flags = flags env.dfhack_flags = flags
env.moduleMode = flags.module env.moduleMode = flags.module
local f local script_code
local perr local perr
local time = dfhack.filesystem.mtime(file) local time = dfhack.filesystem.mtime(file)
if time == scripts[file].mtime and scripts[file].run then if time == scripts[file].mtime and scripts[file].run then
f = scripts[file].run script_code = scripts[file].run
else else
--reload --reload
f, perr = loadfile(file, 't', env) script_code, perr = loadfile(file, 't', env)
if not f then if not script_code then
error(perr) error(perr)
end end
-- avoid updating mtime if the script failed to load -- avoid updating mtime if the script failed to load
scripts[file].mtime = time scripts[file].mtime = time
end end
scripts[file].env = env scripts[file].env = env
scripts[file].run = f scripts[file].run = script_code
return f(...), env return script_code(...), env
end end
local function _run_command(...) local function _run_command(...)

@ -1 +1 @@
Subproject commit 693d58c8588120ad0a179bdd154cf0ce6035c782 Subproject commit 81e2cf023422ad6f01061db12586a0589ef6eac5

@ -1 +1 @@
Subproject commit de996207994e4ce3e221c010c9cc042b06620a2e Subproject commit b285334a8a91c0b43bac9d3e362b95fcbfa472c7