Skip to content

Commit

Permalink
fix: do not pass shell=true on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed May 7, 2024
1 parent e4c9028 commit d47e585
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit d47e585

Please sign in to comment.