mirror of
https://github.com/upscayl/upscayl.git
synced 2024-12-18 18:35:58 +01:00
21 lines
434 B
TypeScript
21 lines
434 B
TypeScript
import { spawn } from "child_process";
|
||
import { execPath } from "./binaries";
|
||
|
||
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(),
|
||
};
|
||
};
|