You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Remove NodeJS v0.10 and v0.12 support
- Change escaping on Windows to use `^` instead of quotes:
- Fix a bug that made it impossible to escape an argument that contained quotes followed by `>` or other special chars, e.g.: `"foo|bar"`, fixes#82
- Fix a bug were a command containing `%x%` would be replaced with the contents of the `x` environment variable, fixes#51
- Fix `options` argument being mutated
Copy file name to clipboardExpand all lines: CHANGELOG.md
+17
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,20 @@
1
+
## 6.0.0 - 2017-11-11
2
+
3
+
- Remove NodeJS v0.10 and v0.12 support
4
+
- Change escaping on Windows to use `^` instead of quotes:
5
+
- Fix a bug that made it impossible to escape an argument that contained quotes followed by `>` or other special chars, e.g.: `"foo|bar"`, fixes [#82](https://github.com./IndigoUnited/node-cross-spawn/issues/82)
6
+
- Fix a bug were a command containing `%x%` would be replaced with the contents of the `x` environment variable, fixes [#51](https://github.com./IndigoUnited/node-cross-spawn/issues/51)
7
+
- Fix `options` argument being mutated
8
+
9
+
10
+
## 5.1.1 - 2017-02-26
11
+
12
+
- Fix `options.shell` support for NodeJS [v4.8](https://github.com./nodejs/node/blob/master/doc/changelogs/CHANGELOG_V4.md#4.8.0)
Copy file name to clipboardExpand all lines: README.md
+9-8
Original file line number
Diff line number
Diff line change
@@ -23,10 +23,6 @@ A cross platform solution to node's spawn and spawnSync.
23
23
24
24
`$ npm install cross-spawn`
25
25
26
-
If you are using `spawnSync` on node 0.10 or older, you will also need to install `spawn-sync`:
27
-
28
-
`$ npm install spawn-sync`
29
-
30
26
31
27
## Why
32
28
@@ -35,7 +31,7 @@ Node has issues when using spawn on Windows:
35
31
- It ignores [PATHEXT](https://github.com./joyent/node/issues/2318)
36
32
- It does not support [shebangs](http://pt.wikipedia.org/wiki/Shebang)
37
33
- No `options.shell` support on node `<v4.8`
38
-
-It does not allow you to run `del` or `dir`
34
+
-Has problems running commands with [spaces](https://github.com./nodejs/node/issues/7367)
39
35
40
36
All these issues are handled correctly by `cross-spawn`.
41
37
There are some known modules, such as [win-spawn](https://github.com./ForbesLindesay/win-spawn), that try to solve this but they are either broken or provide faulty escaping of shell arguments.
####`options.shell` as an alternative to `cross-spawn`
58
+
###Using`options.shell` as an alternative to `cross-spawn`
63
59
64
60
Starting from node `v4.8`, `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:
65
61
66
62
- It's not supported in node `<v4.8`
67
-
- It has no support for shebangs on Windows
68
63
- You must manually escape the command and arguments which is very error prone, specially when passing user input
69
64
70
65
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.
71
66
67
+
### `options.shell` support
68
+
69
+
While `cross-spawn` adds support for `options.shell` in node `<v4.8`, all of its enhancements are disabled.
70
+
71
+
This mimics the Node.js behavior. More specifically, the command and its arguments will not be automatically escaped nor shebang support will be offered. This is by design because if you are using `options.shell` you are probably targeting a specific platform anyway and you don't want things to get into your way.
72
+
72
73
73
-
####Shebangs
74
+
### Shebangs support
74
75
75
76
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`.
0 commit comments