mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-12 20:15:40 +00:00
fix(proxy): clean up temp launch settings
This commit is contained in:
1 parent
3dcf150978
commit
47fbe8bb3a
6 files changed
+93
-15
No files matched your search
@@ -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