-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Prince Mendiratta <[email protected]>
- Loading branch information
1 parent
1401adf
commit 58ad272
Showing
6 changed files
with
33 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,5 @@ build/Release | |
package-lock.json | ||
tmp/*.* | ||
.vs/ | ||
BotsApp.db | ||
.idea/ | ||
.idea/ | ||
BotsApp.db |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const git = require('simple-git')() | ||
// const path = '' | ||
const chalk = require('chalk'); | ||
|
||
const gitPull = async () => { | ||
await git.fetch(); | ||
var newCommits = await git.log(['main..origin/main']) | ||
if (newCommits.total) { | ||
console.log(chalk.blueBright("[INFO] New Update pending, updating...")); | ||
await git.pull("origin", "main", (err, update) => { | ||
if(update && update.summary.changes){ | ||
console.log(chalk.greenBright.bold("[INFO] Updated the bot with latest changes.")); | ||
}else if(err){ | ||
console.log(chalk.redBright.bold("[ERROR] Could not pull latest changes!")); | ||
console.log(err); | ||
} | ||
}); | ||
}else{ | ||
console.log(chalk.greenBright.bold("[INFO] Bot is already working on latest version.")); | ||
} | ||
} | ||
|
||
module.exports = gitPull |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters