Skip to content

Commit 988cd66

Browse files
committedApr 22, 2021
fix: windows ComSpec env variable name
This looks like a typo in the original implementation, based on references to this same variable in the npm cli config. PR-URL: #27 Credit: @ruyadorno Close: #27 Reviewed-by: @wraithgar
1 parent 2a2f1b6 commit 988cd66

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed
 

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ terminal, then it is up to the user to end it, of course.
103103
- The `package.json` fields described in
104104
[RFC183](https://github.com/npm/rfcs/pull/183/files).
105105
- `scriptShell` Optional, defaults to `/bin/sh` on Unix, defaults to
106-
`env.comspec` or `cmd` on Windows. Custom script to use to execute the
106+
`env.ComSpec` or `cmd` on Windows. Custom script to use to execute the
107107
command.
108108
- `stdio` Optional, defaults to `'pipe'`. The same as the `stdio` argument
109109
passed to `child_process` functions in Node.js. Note that if a stdio

‎lib/make-spawn-args.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const makeSpawnArgs = options => {
88
const {
99
event,
1010
path,
11-
scriptShell = isWindows ? process.env.comspec || 'cmd' : 'sh',
11+
scriptShell = isWindows ? process.env.ComSpec || 'cmd' : 'sh',
1212
env = {},
1313
stdio,
1414
cmd,

‎test/make-spawn-args.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ const makeSpawnArgs = requireInject('../lib/make-spawn-args.js', {
1616

1717
if (isWindows) {
1818
t.test('windows', t => {
19-
// with no comspec
20-
delete process.env.comspec
19+
// with no ComSpec
20+
delete process.env.ComSpec
2121
t.match(makeSpawnArgs({
2222
event: 'event',
2323
path: 'path',
@@ -38,8 +38,8 @@ if (isWindows) {
3838
}
3939
])
4040

41-
// with a funky comspec
42-
process.env.comspec = 'blrorp'
41+
// with a funky ComSpec
42+
process.env.ComSpec = 'blrorp'
4343
t.match(makeSpawnArgs({
4444
event: 'event',
4545
path: 'path',

0 commit comments

Comments
 (0)
Please sign in to comment.