mirror of
https://github.com/upscayl/upscayl.git
synced 2024-11-28 01:10:52 +01:00
17 lines
393 B
TypeScript
17 lines
393 B
TypeScript
import { spawn } from "child_process";
|
||
import { execPath } from "./binaries";
|
||
|
||
export const spawnUpscayl = (binaryName: string, command: string[]) => {
|
||
console.log("ℹ Command: ", command);
|
||
|
||
const spawnedProcess = spawn(execPath(binaryName), command, {
|
||
cwd: undefined,
|
||
detached: false,
|
||
});
|
||
|
||
return {
|
||
process: spawnedProcess,
|
||
kill: () => spawnedProcess.kill(),
|
||
};
|
||
};
|