Skip to content

Exit code is 0 when first command succeeds and second fails #55

Open
@nene

Description

@nene

With single command the exit code is as expected:

$ parallelshell "ls asdf"
ls: asdf: No such file or directory
$ echo $?
1

With multiple commands it exits with 1 when the first command exits with 1:

$ parallelshell "ls asdf" "ls ."
asdf: No such file or directory
$ echo $?
1

But when the first command succeeds and second fails, it exits with 0:

$ parallelshell "ls ." "ls asdf"
asdf: No such file or directory
$ echo $?
0

I tried using --wait but then it always exits with 0.

But the documentation says:

If command1 or command2 exit with non-zero exit code, then this will not effect the outcome of your shell (i.e. they can fail and npm/bash/whatever will ignore it). parallelshell will not ignore it, and will exit with the first non-zero exit code.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions