mirror of
https://github.com/tiennm99/ccs.git
synced 2026-08-06 06:23:18 +00:00
fix(proxy): clean up temp launch settings
This commit is contained in:
@@ -208,7 +208,8 @@ export function getWindowsEscapedCommandShell(): SpawnOptions['shell'] {
|
||||
export function execClaude(
|
||||
claudeCli: string,
|
||||
args: string[],
|
||||
envVars: NodeJS.ProcessEnv | null = null
|
||||
envVars: NodeJS.ProcessEnv | null = null,
|
||||
onExitCleanup?: () => void
|
||||
): void {
|
||||
const isWindows = process.platform === 'win32';
|
||||
const isPowerShellScript = isWindows && /\.ps1$/i.test(claudeCli);
|
||||
@@ -286,6 +287,17 @@ export function execClaude(
|
||||
});
|
||||
}
|
||||
|
||||
let cleanedUp = false;
|
||||
const runExitCleanup = (): void => {
|
||||
if (cleanedUp) {
|
||||
return;
|
||||
}
|
||||
cleanedUp = true;
|
||||
onExitCleanup?.();
|
||||
};
|
||||
child.once('exit', runExitCleanup);
|
||||
child.once('error', runExitCleanup);
|
||||
|
||||
wireChildProcessSignals(child, async (err: NodeJS.ErrnoException) => {
|
||||
if (err.code === 'EACCES') {
|
||||
console.error(`[X] Claude CLI is not executable: ${claudeCli}`);
|
||||
|
||||
Reference in New Issue
Block a user