+21
-17
lines changedFilter options
+21
-17
lines changed Original file line number Diff line number Diff line change
@@ -100,8 +100,8 @@ const spawnWithShell = (cmd, args, opts, extra) => {
100
100
let pathToInitial
101
101
try {
102
102
pathToInitial = which.sync(initialCmd, {
103
-
path: (options.env && options.env.PATH) || process.env.PATH,
104
-
pathext: (options.env && options.env.PATHEXT) || process.env.PATHEXT,
103
+
path: (options.env && findInObject(options.env, 'PATH')) || process.env.PATH,
104
+
pathext: (options.env && findInObject(options.env, 'PATHEXT')) || process.env.PATHEXT,
105
105
}).toLowerCase()
106
106
} catch (err) {
107
107
pathToInitial = initialCmd.toLowerCase()
@@ -192,4 +192,14 @@ const stdioResult = (stdout, stderr, { stdioString = true, stdio }) => {
192
192
return result
193
193
}
194
194
195
+
// case insensitive lookup in an object
196
+
const findInObject = (obj, key) => {
197
+
key = key.toLowerCase()
198
+
for (const objKey of Object.keys(obj).sort()) {
199
+
if (objKey.toLowerCase() === key) {
200
+
return obj[objKey]
201
+
}
202
+
}
203
+
}
204
+
195
205
module.exports = promiseSpawn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "@npmcli/promise-spawn",
3
-
"version": "7.0.0",
3
+
"version": "7.0.1",
4
4
"files": [
5
5
"bin/",
6
6
"lib/"
@@ -16,7 +16,7 @@
16
16
"scripts": {
17
17
"test": "tap",
18
18
"snap": "tap",
19
-
"lint": "eslint \"**/*.js\"",
19
+
"lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
20
20
"lintfix": "npm run lint -- --fix",
21
21
"posttest": "npm run lint",
22
22
"postsnap": "npm run lintfix --",
@@ -32,7 +32,7 @@
32
32
},
33
33
"devDependencies": {
34
34
"@npmcli/eslint-config": "^4.0.0",
35
-
"@npmcli/template-oss": "4.18.0",
35
+
"@npmcli/template-oss": "4.21.3",
36
36
"spawk": "^1.7.1",
37
37
"tap": "^16.0.1"
38
38
},
@@ -41,13 +41,7 @@
41
41
},
42
42
"templateOSS": {
43
43
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
44
-
"ciVersions": [
45
-
"16.14.0",
46
-
"16.x",
47
-
"18.0.0",
48
-
"18.x"
49
-
],
50
-
"version": "4.18.0",
44
+
"version": "4.21.3",
51
45
"publish": true
52
46
},
53
47
"dependencies": {
Original file line number Diff line number Diff line change
@@ -95,7 +95,7 @@
95
95
"@npmcli/fs": "^3.1.0",
96
96
"@npmcli/map-workspaces": "^3.0.4",
97
97
"@npmcli/package-json": "^5.0.0",
98
-
"@npmcli/promise-spawn": "^7.0.0",
98
+
"@npmcli/promise-spawn": "^7.0.1",
99
99
"@npmcli/run-script": "^7.0.2",
100
100
"@sigstore/tuf": "^2.2.0",
101
101
"abbrev": "^2.0.0",
@@ -1933,9 +1933,9 @@
1933
1933
}
1934
1934
},
1935
1935
"node_modules/@npmcli/promise-spawn": {
1936
-
"version": "7.0.0",
1937
-
"resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-7.0.0.tgz",
1938
-
"integrity": "sha512-wBqcGsMELZna0jDblGd7UXgOby45TQaMWmbFwWX+SEotk4HV6zG2t6rT9siyLhPk4P6YYqgfL1UO8nMWDBVJXQ==",
1936
+
"version": "7.0.1",
1937
+
"resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-7.0.1.tgz",
1938
+
"integrity": "sha512-P4KkF9jX3y+7yFUxgcUdDtLy+t4OlDGuEBLNs57AZsfSfg+uV6MLndqGpnl4831ggaEdXwR50XFoZP4VFtHolg==",
1939
1939
"inBundle": true,
1940
1940
"dependencies": {
1941
1941
"which": "^4.0.0"
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@
57
57
"@npmcli/fs": "^3.1.0",
58
58
"@npmcli/map-workspaces": "^3.0.4",
59
59
"@npmcli/package-json": "^5.0.0",
60
-
"@npmcli/promise-spawn": "^7.0.0",
60
+
"@npmcli/promise-spawn": "^7.0.1",
61
61
"@npmcli/run-script": "^7.0.2",
62
62
"@sigstore/tuf": "^2.2.0",
63
63
"abbrev": "^2.0.0",
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4