How to use simple-git.gitP:
GitHub: Sabrrii/Padlet
398 399 400 401 402 403 404 405 406 407
// prepare base directory const remoteBaseDir = path.join(__dirname, 'remotes'); await fs.promises.mkdir(remoteBaseDir, { recursive: true }); const baseGit = simpleGit.gitP(remoteBaseDir); for (const remote of config.remotes) { const user = /[^/]+(?=\/prism.git)/.exec(remote.repo); const branch = remote.branch || 'master';
How to use simple-git.fetch:
GitHub: PROHACKER21/Mybot
73 74 75 76 77 78 79 80 81 82
} return version; }; var msgRetryCounterMap = MessageRetryMap; const gitPull = async () => { await git.fetch(); let newCommits = await git.log(["magneum..origin/magneum"]); if (newCommits.total) { logger.info("🐲: Auto Updating..."); require("child_process").exec(
How to use simple-git.log:
GitHub: PROHACKER21/Mybot
74 75 76 77 78 79 80 81 82 83
return version; }; var msgRetryCounterMap = MessageRetryMap; const gitPull = async () => { await git.fetch(); let newCommits = await git.log(["magneum..origin/magneum"]); if (newCommits.total) { logger.info("🐲: Auto Updating..."); require("child_process").exec( "git stash push --include-untracked && git stash drop"
How to use simple-git.pull:
GitHub: PROHACKER21/Mybot
80 81 82 83 84 85 86 87 88 89
if (newCommits.total) { logger.info("🐲: Auto Updating..."); require("child_process").exec( "git stash push --include-untracked && git stash drop" ); await git.pull("origin", "magneum", (err, update) => { if (update && update.summary.changes) { if (update.files.includes("package.json")) require("child_process") .exec("yarn install --ignore-engines")
How to use simple-git.default: