1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-12-18 10:26:04 +01:00
upscayl/electron/utils/spawn-upscayl.ts
2023-09-11 08:37:07 +05:30

21 lines
445 B
TypeScript

import { spawn } from "child_process";
import { execPath } from "./get-resource-paths";
export const spawnUpscayl = (
binaryName: string,
command: string[],
logit: (...args: any) => void
) => {
logit("📢 Upscayl Command: ", command);
const spawnedProcess = spawn(execPath(binaryName), command, {
cwd: undefined,
detached: false,
});
return {
process: spawnedProcess,
kill: () => spawnedProcess.kill(),
};
};