[Pkg-javascript-commits] [node-cross-spawn] 02/04: Merge tag 'upstream/5.1.0'
Ross Gammon
ross-guest at moszumanska.debian.org
Sun Aug 6 18:26:05 UTC 2017
This is an automated email from the git hooks/post-receive script.
ross-guest pushed a commit to branch master
in repository node-cross-spawn.
commit 9f03fddc894e0ec4d19eb60543f9d1b17325e733
Merge: 01c7f29 c5db295
Author: Ross Gammon <rossgammon at mail.dk>
Date: Sun Aug 6 20:05:59 2017 +0200
Merge tag 'upstream/5.1.0'
Upstream version 5.1.0
.npmignore | 3 -
.travis.yml | 1 +
CHANGELOG.md | 6 ++
README.md | 25 +++++-
appveyor.yml | 1 +
lib/enoent.js | 2 +-
lib/parse.js | 169 +++++++++++++++++-----------------------
lib/util/escapeArgument.js | 30 +++++++
lib/util/escapeCommand.js | 12 +++
lib/util/hasEmptyArgumentBug.js | 18 +++++
lib/util/readShebang.js | 37 +++++++++
lib/util/resolveCommand.js | 31 ++++++++
package.json | 4 +-
test/prepare.js | 14 ++++
test/test.js | 81 +++++++++----------
test/util/buffered.js | 2 +
16 files changed, 291 insertions(+), 145 deletions(-)
diff --cc README.md
index 18cc2b8,dde730d..9cea280
--- a/README.md
+++ b/README.md
@@@ -53,14 -54,27 +54,34 @@@ var child = spawn('npm', ['list', '-g'
var results = spawn.sync('npm', ['list', '-g', '-depth', '0'], { stdio: 'inherit' });
```
+## Caveat
+
+On Windows, cross-spawn will only spawn `cmd.exe` if necessary. If the extension
+of the executable is `.exe` or `.com`, it will spawn it directly. If you wish
+to override this behavior and *always* spawn a shell, pass the `{shell: true}`
+option.
+
+ ## Caveats
+
+ #### `options.shell` as an alternative to `cross-spawn`
+
+ Starting from node v6, `spawn` has a `shell` option that allows you run commands from within a shell. This new option solves most of the problems that `cross-spawn` attempts to solve, but:
+
+ - It's not supported in node < v6
+ - It has no support for shebangs on Windows
+ - You must manually escape the command and arguments which is very error prone, specially when passing user input
+
+ If you are using the `shell` option to spawn a command in a cross platform way, consider using `cross-spawn` instead. You have been warned.
+
+
+ #### Shebangs
+
+ While `cross-spawn` handles shebangs on Windows, its support is limited: e.g.: it doesn't handle arguments after the path, e.g.: `#!/bin/bash -e`.
+
+ Remember to always test your code on Windows!
+
+
## Tests
`$ npm test`
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-cross-spawn.git
More information about the Pkg-javascript-commits
mailing list