Skip to content

Commit

Permalink
rm stop file after checking
Browse files Browse the repository at this point in the history
  • Loading branch information
islent committed Dec 26, 2023
1 parent df1ada9 commit 718aa15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/AstroSimBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 718aa15

Please sign in to comment.