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

End run-p process from within process #42

Closed
reggi opened this issue May 26, 2016 · 3 comments
Closed

End run-p process from within process #42

reggi opened this issue May 26, 2016 · 3 comments

Comments

@reggi
Copy link

reggi commented May 26, 2016

I'm writing a ci test that needs to run two commands in parallel, one is the server, the other is the test.

Using run-p start test I can start the server and run the test. There's a notable issue with getting that working here.

https://stackoverflow.com/questions/37466757/how-do-i-run-postmans-newman-in-ci-environment

But after all is said and done, and the test process finishes I need to exit the entire run-p process. Is there away to end the process from within the process?

What I need is sort of like.

run-p start "test && kill {this}"
@mysticatea
Copy link
Owner

Thank you for this issue.

Interesting.
Maybe --race option solves this.
When one script finished, npm-run-all/run-p kills other scripts.

@reggi
Copy link
Author

reggi commented May 27, 2016

@mysticatea Is --race an option? I'm getting ERROR: Invalid Option: --race. Is it implemented yet?

  "scripts": {
    "echo-hi": "echo 'hi'",
    "sleep-15": "sleep 15",
    "sleep-10": "sleep 10",
    "sleep-100": "sleep 100",
    "sleep-1": "sleep 1",
    "start": "run-p sleep-1 sleep-100 --race"
  },

I'm expecting this to exit after 1 ms.

@mysticatea
Copy link
Owner

Yup, I will add the option if it solves your problem :)

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

No branches or pull requests

2 participants