parallelshell
parallelshell copied to clipboard
Suggestions for why parallelshell breaks node-notifier?
I've wanted to add notification to the end of some of my build paths and have run into issues where I'm using parallelshell for watching. That is, the same set of commands ( build:scripts, build:templates, etc. ) are called by two paths, either a npm run build or npm run watch.
In the case of the former, the build script simply calls npm run build:scripts && npm run build:templates.
In the case of the latter, there are nodemon's watching a directory that call the corresponding script ( build:scripts, build:templates, etc. ) as things become available.
If I put a call to notify in, say, build:templates, it works fine if I call it directly ( either npm run build or npm run build:templates ). However, if it is called inside parallelshell it fails ( npm run watch -> nodemon ).
You can try it out for yourself by using this simple package:
{
"dependencies": {
"node-notifier": "^4.5.0",
"parallelshell": "^2.0.0"
},
"scripts": {
"works": "npm run notify",
"broken": "parallelshell \"npm run notify\"",
"notify": "notify -t \"Some Title\" -m \"Some Message\" || echo 'failed'"
}
}