-
Notifications
You must be signed in to change notification settings - Fork 247
Support quoting scripts to run multiple scripts with the same process.env #77
Conversation
That should do the trick, it's basically what |
Thanks for chiming in @DanReyLop. Hmmm... Not certain I follow though. Could you make a PR? |
I've hacked something together here. Obviously it's not production-ready, but it should illustrate my point. The idea is to wrap everything into a shell, so for example: Using |
Looking at |
Sweet! I think that I'm good with raising the minimum requirement to 4.8. Most people should be there (or will be soon) anyway. Besides, the old cross-env works just fine :) |
Use the shell option of spawn introduced in Node.js 4.8 (see nodejs/node#4598) to pass the command to the OS shell. Supersedes kentcdodds#77. BREAKING CHANGE: Changes the behavior when passed quoted scripts or special characters interpreted by the shell.
Use the shell option of spawn introduced in Node.js 4.8 (see nodejs/node#4598) to pass the command to the OS shell. Supersedes kentcdodds#77. BREAKING CHANGE: Changes the behavior when passed quoted scripts or special characters interpreted by the shell.
* feat(spawn): add support for quoted scripts Use the shell option of spawn introduced in Node.js 4.8 (see nodejs/node#4598) to pass the command to the OS shell. Supersedes #77. * docs(readme): add gotchas Add Gotchas paragraph about passing variables to multiple scripts. * docs(readme): add required node version badge Replace the Prerequisite paragraph by a badge showing the require version of Node.js required to run cross-env. * test(spawn): add test for quoted scripts See #89 (review). BREAKING CHANGE: Changes the behavior when passed quoted scripts or special characters interpreted by the shell.
#89 replaces this PR. |
* feat(spawn): add support for quoted scripts Use the shell option of spawn introduced in Node.js 4.8 (see nodejs/node#4598) to pass the command to the OS shell. Supersedes #77. * docs(readme): add gotchas Add Gotchas paragraph about passing variables to multiple scripts. * docs(readme): add required node version badge Replace the Prerequisite paragraph by a badge showing the require version of Node.js required to run cross-env. * test(spawn): add test for quoted scripts See #89 (review). BREAKING CHANGE: Changes the behavior when passed quoted scripts or special characters interpreted by the shell.
This passes all the tests, but I don't think that we should do this.
cross-spawn
does a LOT more thanspawn-command
. The only problem is thatcross-spawn
requires that the args are an array which would require parsing out the command. Unless there's a way to forward the whole string to a command and have that be evaluated... I thinkeval
may work on unix, but what about windows?Help needed!