1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-12-18 18:35:58 +01:00
upscayl/electron/utils/spawn-upscayl.ts
2024-04-21 22:44:39 +05:30

27 lines
504 B
TypeScript

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