diff --git a/src/AstroSimBase.jl b/src/AstroSimBase.jl index 805afd1..49f1c83 100644 --- a/src/AstroSimBase.jl +++ b/src/AstroSimBase.jl @@ -74,8 +74,11 @@ function need_to_interrupt(OutputDir::String) If there is a file named `stop` in folder `OutputDir`, return true; else, return `false`. """ -function need_to_interrupt(OutputDir::String) +function need_to_interrupt(OutputDir::String; remove = false) if isfile(joinpath(OutputDir, "stop")) + if remove + rm(joinpath(OutputDir, "stop"), force = true) + end return true else return false diff --git a/test/runtests.jl b/test/runtests.jl index 5a4e589..d96d1ee 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -38,4 +38,6 @@ end @test_broken need_to_interrupt("output") interrupt("output") @test need_to_interrupt("output") + @test need_to_interrupt("output", remove = true) + @test !isfile("output/stop") end