diff --git a/packages/cli/src/utils/sandbox.ts b/packages/cli/src/utils/sandbox.ts index 95f23d82075..6459e3c1447 100644 --- a/packages/cli/src/utils/sandbox.ts +++ b/packages/cli/src/utils/sandbox.ts @@ -4,7 +4,13 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { exec, execSync, spawn, type ChildProcess } from 'node:child_process'; +import { + exec, + execSync, + execFileSync, + spawn, + type ChildProcess, +} from 'node:child_process'; import os from 'node:os'; import path from 'node:path'; import fs from 'node:fs'; @@ -784,7 +790,11 @@ export async function start_sandbox( // install handlers to stop proxy on exit/signal const stopProxy = () => { console.log('stopping proxy container ...'); - execSync(`${config.command} rm -f ${SANDBOX_PROXY_NAME}`); + try { + execFileSync(config.command, ['rm', '-f', SANDBOX_PROXY_NAME]); + } catch (_e) { + /* Ignore error */ + } }; process.on('exit', stopProxy); process.on('SIGINT', stopProxy);