Skip to content

Commit 2255153

Browse files
committed
Add another constants.distInstrumentWithSentryPath --require point
1 parent 2025cce commit 2255153

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/utils/npm.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { getNpmBinPath } from '../shadow/npm/paths'
1515

1616
import type { Spinner } from '@socketsecurity/registry/lib/spinner'
1717

18-
const { SOCKET_IPC_HANDSHAKE } = constants
18+
const { SOCKET_CLI_SENTRY_BUILD, SOCKET_IPC_HANDSHAKE } = constants
1919

2020
type SpawnOption = Exclude<Parameters<typeof spawn>[2], undefined>
2121

@@ -51,6 +51,14 @@ export function safeNpmInstall(options?: SafeNpmInstallOptions) {
5151
...constants.nodeHardenFlags,
5252
// Lazily access constants.nodeNoWarningsFlags.
5353
...constants.nodeNoWarningsFlags,
54+
// Lazily access constants.ENV[SOCKET_CLI_SENTRY_BUILD].
55+
...(constants.ENV[SOCKET_CLI_SENTRY_BUILD]
56+
? [
57+
'--require',
58+
// Lazily access constants.distInstrumentWithSentryPath.
59+
constants.distInstrumentWithSentryPath
60+
]
61+
: []),
5462
'--require',
5563
// Lazily access constants.distShadowNpmInjectPath.
5664
constants.distShadowNpmInjectPath,

0 commit comments

Comments
 (0)