Files
tspm/ts/cli/utils/ipc.ts
2025-08-28 15:47:59 +00:00

14 lines
359 B
TypeScript

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
}
}
}