From 1f49d4a7cf5d44b20fdf73666769911d34f1dc73 Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 31 Mar 2022 23:54:25 -0400 Subject: [PATCH] test: quickfort/ecosystem: avoid assuming output folder exists --- test/quickfort/ecosystem.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/quickfort/ecosystem.lua b/test/quickfort/ecosystem.lua index df2e87079..5b863f9ac 100644 --- a/test/quickfort/ecosystem.lua +++ b/test/quickfort/ecosystem.lua @@ -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()