Skip to content

Commit dc91e32

Browse files
committed
Include shell option for win32
1 parent 6520890 commit dc91e32

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

src/constants.mts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,16 @@ const YARN_LOCK = 'yarn.lock'
236236

237237
let _Sentry: any
238238

239-
let _stdioPipeOptions: SpawnOptions | undefined
240-
function getStdioPipeOptions() {
241-
if (_stdioPipeOptions === undefined) {
242-
_stdioPipeOptions = { cwd: process.cwd() }
239+
let _npmStdioPipeOptions: SpawnOptions | undefined
240+
function getNpmStdioPipeOptions() {
241+
if (_npmStdioPipeOptions === undefined) {
242+
_npmStdioPipeOptions = {
243+
cwd: process.cwd(),
244+
// Lazily access constants.WIN32.
245+
shell: constants.WIN32,
246+
}
243247
}
244-
return _stdioPipeOptions
248+
return _npmStdioPipeOptions
245249
}
246250

247251
const LAZY_ENV = () => {
@@ -539,23 +543,23 @@ const lazyNpmCachePath = () => {
539543
const {
540544
spawnSync,
541545
} = /*@__PURE__*/ require('@socketsecurity/registry/lib/spawn')
542-
// Lazily access constants.npmRealExecPath.
546+
// Lazily access constants.npmExecPath.
543547
return spawnSync(
544-
constants.npmRealExecPath,
548+
constants.npmExecPath,
545549
['config', 'get', 'cache'],
546-
getStdioPipeOptions(),
550+
getNpmStdioPipeOptions(),
547551
).stdout
548552
}
549553

550554
const lazyNpmGlobalPrefix = () => {
551555
const {
552556
spawnSync,
553557
} = /*@__PURE__*/ require('@socketsecurity/registry/lib/spawn')
554-
// Lazily access constants.npmRealExecPath.
558+
// Lazily access constants.npmExecPath.
555559
return spawnSync(
556-
constants.npmRealExecPath,
560+
constants.npmExecPath,
557561
['prefix', '-g'],
558-
getStdioPipeOptions(),
562+
getNpmStdioPipeOptions(),
559563
).stdout
560564
}
561565

0 commit comments

Comments
 (0)