Skip to content

Commit

Permalink
0.10.6: wrap pwd() in try-catch block
Browse files Browse the repository at this point in the history
  • Loading branch information
cihga39871 committed Apr 10, 2024
1 parent 1c03d17 commit 33f7ce3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Pipelines"
uuid = "ef544631-5c6f-4e9b-994c-12e7a4cd724c"
authors = ["Jiacheng Chuan <jiacheng_chuan@outlook.com>"]
version = "0.10.5"
version = "0.10.6"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
4 changes: 4 additions & 0 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## v0.10.6

- Fix: `run(::Program)`: wrap `pwd()` in try-catch block in case the dir no longer exists. It happens because workding dir is not thread safe in Julia. If other program delete the directory, it will fail.

## v0.10.5

- Compat: Julia v1.10: `hasmethod(f, t)` in Julia v1.10 changed its behavior. It affects Program function check. Use `length(methods(f, t))` instead.
Expand Down
7 changes: 6 additions & 1 deletion src/Program.jl
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,12 @@ function Base.run(p::Program;
stdout = nothing, stderr = nothing, stdlog = stderr, append::Bool = false, _do_parse_program_args::Bool = true, kwarg...
)
if dir != ""
dir_backup = pwd()
dir_backup = try
# in case the dir no longer exists. happens because workding dir is not thread safe in Julia. If other program delete the directory, it will fail.
pwd()
catch
""
end
dir = abspath(dir)
cd(dir) # go to working directory
end
Expand Down

0 comments on commit 33f7ce3

Please sign in to comment.