From d47e5852427dec7cddff14bbca13d0bdbc4ebbb7 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Tue, 7 May 2024 11:50:00 -0600 Subject: [PATCH] fix: do not pass shell=true on windows --- src/telemetry.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/telemetry.ts b/src/telemetry.ts index abe21125..a44401d1 100644 --- a/src/telemetry.ts +++ b/src/telemetry.ts @@ -222,13 +222,11 @@ export default class Telemetry extends AsyncCreatable { const processPath = join(dirname(fileURLToPath(import.meta.url)), '..', 'processes', 'upload.js'); const telemetryDebug = env.getBoolean('SF_TELEMETRY_DEBUG', false); - const nodePath = process.argv[0]; // Don't spawn if we are in telemetry debug. This allows us to run the process manually with --inspect-brk. if (!telemetryDebug) { - debug(`Spawning "${nodePath} ${processPath} ${Telemetry.cacheDir} ${this.getTelemetryFilePath()}"`); - cp.spawn(nodePath, [processPath, Telemetry.cacheDir, this.getTelemetryFilePath()], { - ...(process.platform === 'win32' ? { shell: true } : {}), + debug(`Spawning "${process.execPath} ${processPath} ${Telemetry.cacheDir} ${this.getTelemetryFilePath()}"`); + cp.spawn(process.execPath, [processPath, Telemetry.cacheDir, this.getTelemetryFilePath()], { detached: true, stdio: 'ignore', }).unref();