Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teardown commands #500

Merged
merged 4 commits into from
Aug 28, 2024
Merged

Teardown commands #500

merged 4 commits into from
Aug 28, 2024

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
21 checks passed
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Teardown command?
3 participants