2023-03-12 15:19:02 +05:30
|
|
|
import { spawn } from "child_process";
|
2023-09-10 23:30:49 +05:30
|
|
|
import { execPath } from "./get-resource-paths";
|
2023-03-12 15:19:02 +05:30
|
|
|
|
2023-05-01 12:25:56 +05:30
|
|
|
export const spawnUpscayl = (
|
|
|
|
binaryName: string,
|
|
|
|
command: string[],
|
|
|
|
logit: (...args: any) => void
|
|
|
|
) => {
|
2023-05-01 13:14:12 +05:30
|
|
|
logit("📢 Upscayl Command: ", command);
|
2023-03-12 15:19:02 +05:30
|
|
|
|
2023-10-14 06:30:49 +05:30
|
|
|
const spawnedProcess = spawn(execPath("bin"), command, {
|
2023-03-12 15:19:02 +05:30
|
|
|
cwd: undefined,
|
|
|
|
detached: false,
|
|
|
|
});
|
|
|
|
|
|
|
|
return {
|
|
|
|
process: spawnedProcess,
|
|
|
|
kill: () => spawnedProcess.kill(),
|
|
|
|
};
|
|
|
|
};
|