From 3b7f6f274aceed4218e5e903752d879a41d3a547 Mon Sep 17 00:00:00 2001 From: Gar Date: Fri, 5 Jan 2024 07:42:07 -0800 Subject: [PATCH] deps: @npmcli/promise-spawn@7.0.1 --- node_modules/@npmcli/promise-spawn/lib/index.js | 14 ++++++++++++-- node_modules/@npmcli/promise-spawn/package.json | 14 ++++---------- package-lock.json | 8 ++++---- package.json | 2 +- 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/node_modules/@npmcli/promise-spawn/lib/index.js b/node_modules/@npmcli/promise-spawn/lib/index.js index 571ff6b9169c9..b31395ebb5bcd 100644 --- a/node_modules/@npmcli/promise-spawn/lib/index.js +++ b/node_modules/@npmcli/promise-spawn/lib/index.js @@ -100,8 +100,8 @@ const spawnWithShell = (cmd, args, opts, extra) => { let pathToInitial try { pathToInitial = which.sync(initialCmd, { - path: (options.env && options.env.PATH) || process.env.PATH, - pathext: (options.env && options.env.PATHEXT) || process.env.PATHEXT, + path: (options.env && findInObject(options.env, 'PATH')) || process.env.PATH, + pathext: (options.env && findInObject(options.env, 'PATHEXT')) || process.env.PATHEXT, }).toLowerCase() } catch (err) { pathToInitial = initialCmd.toLowerCase() @@ -192,4 +192,14 @@ const stdioResult = (stdout, stderr, { stdioString = true, stdio }) => { return result } +// case insensitive lookup in an object +const findInObject = (obj, key) => { + key = key.toLowerCase() + for (const objKey of Object.keys(obj).sort()) { + if (objKey.toLowerCase() === key) { + return obj[objKey] + } + } +} + module.exports = promiseSpawn diff --git a/node_modules/@npmcli/promise-spawn/package.json b/node_modules/@npmcli/promise-spawn/package.json index ffd89f1083341..6e161b7404b85 100644 --- a/node_modules/@npmcli/promise-spawn/package.json +++ b/node_modules/@npmcli/promise-spawn/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/promise-spawn", - "version": "7.0.0", + "version": "7.0.1", "files": [ "bin/", "lib/" @@ -16,7 +16,7 @@ "scripts": { "test": "tap", "snap": "tap", - "lint": "eslint \"**/*.js\"", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "lintfix": "npm run lint -- --fix", "posttest": "npm run lint", "postsnap": "npm run lintfix --", @@ -32,7 +32,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.18.0", + "@npmcli/template-oss": "4.21.3", "spawk": "^1.7.1", "tap": "^16.0.1" }, @@ -41,13 +41,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "ciVersions": [ - "16.14.0", - "16.x", - "18.0.0", - "18.x" - ], - "version": "4.18.0", + "version": "4.21.3", "publish": true }, "dependencies": { diff --git a/package-lock.json b/package-lock.json index 669da5c0ee4fd..55a0aeb3aec9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -95,7 +95,7 @@ "@npmcli/fs": "^3.1.0", "@npmcli/map-workspaces": "^3.0.4", "@npmcli/package-json": "^5.0.0", - "@npmcli/promise-spawn": "^7.0.0", + "@npmcli/promise-spawn": "^7.0.1", "@npmcli/run-script": "^7.0.2", "@sigstore/tuf": "^2.2.0", "abbrev": "^2.0.0", @@ -1933,9 +1933,9 @@ } }, "node_modules/@npmcli/promise-spawn": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-7.0.0.tgz", - "integrity": "sha512-wBqcGsMELZna0jDblGd7UXgOby45TQaMWmbFwWX+SEotk4HV6zG2t6rT9siyLhPk4P6YYqgfL1UO8nMWDBVJXQ==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-7.0.1.tgz", + "integrity": "sha512-P4KkF9jX3y+7yFUxgcUdDtLy+t4OlDGuEBLNs57AZsfSfg+uV6MLndqGpnl4831ggaEdXwR50XFoZP4VFtHolg==", "inBundle": true, "dependencies": { "which": "^4.0.0" diff --git a/package.json b/package.json index 7e2dd422162fc..f12554d0588d7 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "@npmcli/fs": "^3.1.0", "@npmcli/map-workspaces": "^3.0.4", "@npmcli/package-json": "^5.0.0", - "@npmcli/promise-spawn": "^7.0.0", + "@npmcli/promise-spawn": "^7.0.1", "@npmcli/run-script": "^7.0.2", "@sigstore/tuf": "^2.2.0", "abbrev": "^2.0.0",