test: quickfort/ecosystem: avoid assuming output folder exists

develop
lethosor 2022-03-31 23:54:25 -04:00 committed by Myk
parent 8a120837c6
commit 1f49d4a7cf
1 changed files with 5 additions and 3 deletions

@ -40,9 +40,11 @@ local phase_names = utils.invert(blueprint.valid_phases)
-- inspection of failed results)
local function test_wrapper(test_fn)
local outdir = blueprints_dir .. output_dir
for _, v in ipairs(dfhack.filesystem.listdir_recursive(outdir)) do
if not v.isdir then
os.remove(v.path)
if dfhack.filesystem.exists(outdir) then
for _, v in ipairs(dfhack.filesystem.listdir_recursive(outdir)) do
if not v.isdir then
os.remove(v.path)
end
end
end
test_fn()