fix: execute the Arduino CLI without a shell

Closes arduino/arduino-ide#2112
Ref: arduino/arduino-ide#2067

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
Akos Kitta 2023-08-20 18:03:45 +02:00 committed by Akos Kitta
parent 9a99957e73
commit 2aae9e0a07

View File

@ -173,10 +173,9 @@ export class ArduinoDaemonImpl
const cliPath = this.getExecPath();
const ready = new Deferred<{ daemon: ChildProcess; port: string }>();
const options = {
shell: true,
env: { ...deepClone(process.env), NO_COLOR: String(true) },
};
const daemon = spawn(`"${cliPath}"`, args, options);
const daemon = spawn(cliPath, args, options);
// If the process exists right after the daemon gRPC server has started (due to an invalid port, unknown address, TCP port in use, etc.)
// we have no idea about the root cause unless we sniff into the first data package and dispatch the logic on that. Note, we get a exit code 1.