Skip to content

Commit c6e7650

Browse files
authored
spawn: ignorestatus should work on CmdRedirect (JuliaLang#59358)
It works on the other AbstractCmds, the fact that it doesn't work on this one is an oversight.
1 parent 096011c commit c6e7650

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

base/cmd.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ Mark a command object so that running it will not throw an error if the result c
225225
ignorestatus(cmd::Cmd) = Cmd(cmd, ignorestatus=true)
226226
ignorestatus(cmd::Union{OrCmds,AndCmds}) =
227227
typeof(cmd)(ignorestatus(cmd.a), ignorestatus(cmd.b))
228+
ignorestatus(cmd::CmdRedirect) =
229+
CmdRedirect(ignorestatus(cmd.cmd), cmd.handle, cmd.stream_no, cmd.readable)
228230

229231
"""
230232
detach(command)

test/spawn.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ end
124124
@test !success(ignorestatus(falsecmd) & falsecmd)
125125
@test_broken success(ignorestatus(pipeline(falsecmd, falsecmd)))
126126
@test_broken success(ignorestatus(falsecmd & falsecmd))
127+
@test run(ignorestatus(pipeline(falsecmd; stderr=devnull, stdout=devnull))).exitcode != 0
127128

128129
# stdin Redirection
129130
let file = tempname()

0 commit comments

Comments
 (0)