open-cli-tools / concurrently

Run commands concurrently. Like `npm run watch-js & npm run watch-less` but better.
https://www.npmjs.com/package/concurrently
MIT License
7k stars 228 forks source link

Success flag not triggered in v8.2.0 #428

Closed TommyRiquet closed 1 year ago

TommyRiquet commented 1 year ago
gustavohenke commented 1 year ago

So what's the issue exactly, --kill-others or --success flag? Your description implies that it's a problem with --kill-others, but maybe you really meant --success...?

TommyRiquet commented 1 year ago

So what's the issue exactly, --kill-others or --success flag? Your description implies that it's a problem with --kill-others, but maybe you really meant --success...?

The --success flag should be triggered whenever the first task exit with a 0 code, here it doesn't.

I also tried removing the --kill-others flag but it didn't change anything

gustavohenke commented 1 year ago

--success doesn't trigger anything, it defines which process guides the exit code of concurrently.

Also note that the --help says that

  -s, --success                Which command(s) must exit with code 0 in order
                               for concurrently exit with code 0 too. Options
                               are:
                               - "first" for the first command to exit;
                               - "last" for the last command to exit;
                               - "all" for all commands;
                               - "command-{name}"/"command-{index}" for the
                               commands with that name or index;
                               - "!command-{name}"/"!command-{index}" for all
                               commands but the ones with that name or index.
                                                                [default: "all"]
TommyRiquet commented 1 year ago

Nevermind, let me rephrase my statement. Please excuse my poor choice of words, as English is not my native language.

The command mentioned earlier that when the first process exits with a code of 0, the concurrently process should also exit with code 0.

However, this was not the case in this instance.

Although the process did exit with code 0, the workflow continued until I manually cancelled it.

If you would like to review it yourself, here is the GitHub action in question. https://github.com/TommyRiquet/PVonWeb/actions/runs/5234324290/jobs/9450387941

paescuj commented 1 year ago

Nevermind, let me rephrase my statement. Please excuse my poor choice of words, as English is not my native language.

The command mentioned earlier that when the first process exits with a code of 0, the concurrently process should also exit with code 0.

However, this was not the case in this instance.

Although the process did exit with code 0, the workflow continued until I manually cancelled it.

If you would like to review it yourself, here is the GitHub action in question. https://github.com/TommyRiquet/PVonWeb/actions/runs/5234324290/jobs/9450387941

That's because you were using the --kill-others-on-fail flag in the linked workflow. With this flag it will kill other processes only if one command exits with non zero status code.

TommyRiquet commented 1 year ago

Okay, I apologize for any confusion . I misunderstood the flag. I switched to the "--kill-others" flag and everything worked perfectly fine. I'm sorry for any inconvenience caused by the time lost.