HTTPS Monitor using Real Browsers + Limited plugin support (#1787)

This commit is contained in:
Louis Lam
2023-01-27 18:25:57 +08:00
committed by GitHub
parent d99d37898e
commit e5ca67d062
16 changed files with 616 additions and 7 deletions

24
server/git.js Normal file
View File

@@ -0,0 +1,24 @@
const childProcess = require("child_process");
class Git {
static clone(repoURL, cwd, targetDir = ".") {
let result = childProcess.spawnSync("git", [
"clone",
repoURL,
targetDir,
], {
cwd: cwd,
});
if (result.status !== 0) {
throw new Error(result.stderr.toString("utf-8"));
} else {
return result.stdout.toString("utf-8") + result.stderr.toString("utf-8");
}
}
}
module.exports = {
Git,
};