userpluginInstaller/native.ts

16 lines
484 B
TypeScript
Raw Normal View History

2024-11-01 13:10:56 -04:00
import { exec, spawn } from "child_process";
import { IpcMainInvokeEvent } from "electron";
export async function cloneRepo(_: IpcMainInvokeEvent, repo: string, clonePath: string): Promise<any> {
return new Promise((resolve, reject) => {
exec(`git clone ${repo} ${clonePath}`, (error, stdout, stderr) => {
if (error) {
return reject(
stderr
);
}
resolve(null);
});
});
}