1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-12-01 02:27:16 +01:00
upscayl/electron/utils/spawn-upscayl.ts

21 lines
445 B
TypeScript
Raw Normal View History

2023-03-12 10:49:02 +01:00
import { spawn } from "child_process";
2023-09-10 20:00:49 +02:00
import { execPath } from "./get-resource-paths";
2023-03-12 10:49:02 +01:00
2023-05-01 08:55:56 +02:00
export const spawnUpscayl = (
binaryName: string,
command: string[],
logit: (...args: any) => void
) => {
logit("📢 Upscayl Command: ", command);
2023-03-12 10:49:02 +01:00
const spawnedProcess = spawn(execPath(binaryName), command, {
cwd: undefined,
detached: false,
});
return {
process: spawnedProcess,
kill: () => spawnedProcess.kill(),
};
};