Skip to content

Commit 7b937d5

Browse files
committed
Continue WIN32 fixes
1 parent 70f87d6 commit 7b937d5

File tree

6 files changed

+16
-7
lines changed

6 files changed

+16
-7
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
"@socketregistry/is-interactive": "1.0.5",
106106
"@socketregistry/packageurl-js": "1.0.6",
107107
"@socketsecurity/config": "2.1.3",
108-
"@socketsecurity/registry": "1.0.156",
108+
"@socketsecurity/registry": "1.0.157",
109109
"@socketsecurity/sdk": "1.4.29",
110110
"@types/blessed": "0.1.25",
111111
"@types/cmd-shim": "5.0.2",

src/commands/raw-npm/run-raw-npm.mts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import { spawn } from '@socketsecurity/registry/lib/spawn'
22

3+
import constants from '../../constants.mts'
34
import { getNpmBinPath } from '../../shadow/npm/paths.mts'
45

56
export async function runRawNpm(
67
argv: string[] | readonly string[]
78
): Promise<void> {
89
const spawnPromise = spawn(getNpmBinPath(), argv as string[], {
10+
// Lazily access constants.WIN32.
11+
shell: constants.WIN32,
912
stdio: 'inherit'
1013
})
1114
// See https://nodejs.org/api/all.html#all_child_process_event-exit.

src/commands/raw-npx/run-raw-npx.mts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import { spawn } from '@socketsecurity/registry/lib/spawn'
22

3+
import constants from '../../constants.mts'
34
import { getNpxBinPath } from '../../shadow/npm/paths.mts'
45

56
export async function runRawNpx(
67
argv: string[] | readonly string[]
78
): Promise<void> {
89
const spawnPromise = spawn(getNpxBinPath(), argv as string[], {
10+
// Lazily access constants.WIN32.
11+
shell: constants.WIN32,
912
stdio: 'inherit'
1013
})
1114
// See https://nodejs.org/api/all.html#all_child_process_event-exit.

src/utils/agent.mts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ export function runAgentInstall(
3838
const skipNodeHardenFlags =
3939
agent === PNPM && pkgEnvDetails.agentVersion.major < 11
4040
return spawn(agentExecPath, ['install', ...args], {
41+
// Lazily access constants.WIN32.
42+
shell: constants.WIN32,
4143
spinner,
4244
stdio: 'inherit',
4345
...spawnOptions,

src/utils/npm.mts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import {
33
isAuditFlag,
44
isFundFlag,
55
isLoglevelFlag,
6-
isProgressFlag
6+
isProgressFlag,
7+
realExecPathSync
78
} from '@socketsecurity/registry/lib/npm'
89
import { isObject } from '@socketsecurity/registry/lib/objects'
910
import { spawn } from '@socketsecurity/registry/lib/spawn'
@@ -76,7 +77,7 @@ export function safeNpmInstall(options?: SafeNpmInstallOptions) {
7677
'--require',
7778
// Lazily access constants.distShadowNpmInjectPath.
7879
constants.distShadowNpmInjectPath,
79-
agentExecPath,
80+
realExecPathSync(agentExecPath),
8081
'install',
8182
// Avoid code paths for 'audit' and 'fund'.
8283
'--no-audit',

0 commit comments

Comments
 (0)