cloning
This commit is contained in:
parent
7cd4dc5bdc
commit
9a83a6a012
3 changed files with 59 additions and 18 deletions
15
native.ts
Normal file
15
native.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
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);
|
||||
});
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue