darkguy2008 / parallelshell

Run multiple shell commands in parallel
501 stars 44 forks source link

cant set env vars on 2.0.0 #28

Open burabure opened 9 years ago

burabure commented 9 years ago

I think this is because of the switch to exec.

this used to work: parallelshell \"NODE_ENV=development nodemon index.js\" \"node webpack-server.js\" \"npm run watch\"

now it throws

parallelshell "export NODE_ENV=development && nodemon index.js"  "node webpack-server.js" "npm run watch"

sh: 1: exec: export: not found
....
keithamus commented 9 years ago

Hey @burabure thanks for the issue.

You could always run it this way instead:

NODE_ENV=development parallelshell \"nodemon index.js\" \"node webpack-server.js\" \"npm run watch\"

@paulpflug I think we should look at another solution. Possibly revert 2.0.0?

paulpflug commented 9 years ago

I think so too.. Maybe we have to take the kill by pgid route. But first I will add more tests with ENV, &&, nesting and everything.

Am 28. Juli 2015 23:36:27 schrieb Keith Cirkel notifications@github.com:

Hey @burabure thanks for the issue.

You could always run it this way instead:

NODE_ENV=development parallelshell \"nodemon index.js\" \"node 
webpack-server.js\" \"npm run watch\"

@paulpflug I think we should look at another solution. Possibly revert 2.0.0?


Reply to this email directly or view it on GitHub: https://github.com/keithamus/parallelshell/issues/28#issuecomment-125760264

keithamus commented 9 years ago

:+1:

paulpflug commented 9 years ago

@burabure could you try the version on dev branch?

hagaigold commented 6 years ago

@darkguy2008 , let me know if this is something of interest to this module: a very simple implementation for supporting env vars - fc75e0896fa0eb5168caf1d5b6c461bc0bc9686b

there is already a module for this, cross-env, that does it much better. so if someone need more complicate parsing, he can always combine the two: calling from parallelshell to cross-env or the other way around.

anyway, I add it with an experimental flag, so it should not create a breaking change (hopefully).