mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-11 19:45:58 +08:00
HTTPS Monitor using Real Browsers + Limited plugin support (#1787)
This commit is contained in:
24
server/git.js
Normal file
24
server/git.js
Normal 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,
|
||||
};
|
Reference in New Issue
Block a user