mirror of
https://github.com/upscayl/upscayl.git
synced 2024-11-14 10:47:56 +01:00
21 lines
440 B
TypeScript
21 lines
440 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("bin"), command, {
|
|
cwd: undefined,
|
|
detached: false,
|
|
});
|
|
|
|
return {
|
|
process: spawnedProcess,
|
|
kill: () => spawnedProcess.kill(),
|
|
};
|
|
};
|