I also added a check that JSON/H5/slurm directories do exist before attempting to delete them.
Previously, the cleanup code would error if we tried to delete a directory that was already deleted.
The if abspath(PROGRAM_FILE) == @__FILE__ check at the end ensures that code only gets executed if the script is called from the command line as julia slurm/cleanup.jl.
This makes it easier to include the file in a REPL session, without triggering any code execution at include time.
I also added a check that JSON/H5/slurm directories do exist before attempting to delete them. Previously, the
cleanup
code would error if we tried to delete a directory that was already deleted.The
if abspath(PROGRAM_FILE) == @__FILE__
check at the end ensures that code only gets executed if the script is called from the command line asjulia slurm/cleanup.jl
. This makes it easier toinclude
the file in a REPL session, without triggering any code execution atinclude
time.No impact on source code.