update
This commit is contained in:
14
ts/cli/utils/ipc.ts
Normal file
14
ts/cli/utils/ipc.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { tspmIpcClient } from '../../classes.ipcclient.js';
|
||||
|
||||
// Helper function to run IPC commands with automatic disconnect
|
||||
export async function runIpcCommand<T>(body: () => Promise<T>): Promise<T> {
|
||||
try {
|
||||
return await body();
|
||||
} finally {
|
||||
try {
|
||||
await tspmIpcClient.disconnect();
|
||||
} catch {
|
||||
// Ignore disconnect errors
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user