Skip to content

Conversation

@gustavohenke
Copy link
Member

Introduces a --teardown flag to pass commands that execute when every input command exits.

$ concurrently --teardown "echo bye" "echo hey"
[0] hey
[0] echo hey exited with code 0
--> Running teardown command "echo bye"
bye
--> Teardown command "echo bye" exited with code 0

As you can see, teardown commands have no prefixing.

The flag can also be specified multiple times:

$ concurrently --teardown "echo bye" --teardown "echo real bye" "echo hey"
[0] hey
[0] echo hey exited with code 0
--> Running teardown command "echo bye"
bye
--> Teardown command "echo bye" exited with code 0
--> Running teardown command "echo real bye"
real bye
--> Teardown command "echo real bye" exited with code 0

Teardown commands also don't affect concurrently's exit code (unless it fails to spawn):

$ concurrently --teardown "exit 1" "echo hey"
[0] hey
[0] echo hey exited with code 0
--> Running teardown command "exit 1"
--> Teardown command "exit 1" exited with code 1

$ echo $?
0

Closes #472

@gustavohenke gustavohenke added this to the v9 milestone Aug 25, 2024
@coveralls
Copy link

coveralls commented Aug 25, 2024

Coverage Status

coverage: 98.677% (-0.5%) from 99.208%
when pulling 2fb4ed1 on teardown
into aa338ac on main.

@gustavohenke gustavohenke merged commit 950132d into main Aug 28, 2024
@gustavohenke gustavohenke deleted the teardown branch August 28, 2024 23:17
@FezVrasta
Copy link

Thanks for the feature! Can't wait to try it

@FezVrasta
Copy link

When can we expect a new release with this?

@gustavohenke
Copy link
Member Author

Hey! I had been working on a few other breaking changes - just shipped it as a major version.
Check out the release notes: https://github.com/open-cli-tools/concurrently/releases/tag/v9.0.0

@FezVrasta
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Teardown command?

4 participants