mirror of https://github.com/IoTcat/cron-git.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
491 B
18 lines
491 B
const cron = require('node-schedule'); |
|
const git = require('simple-git')(); |
|
|
|
|
|
|
|
/* |
|
cron.scheduleJob('1-50 * * * * *', function(){ |
|
console.log('scheduleCronstyle:' + new Date()); |
|
}); |
|
*/ |
|
|
|
|
|
git.pull('origin', 'master', {'--no-rebase': null}, ()=>{console.log(new Date() + ' - cron-git: git pull done.' + require('os').hostname())}); |
|
|
|
|
|
git.add('./*') |
|
.commit("Committed by cron-git auto") |
|
.push(['-u', 'origin', 'master'], () => console.log(new Date() + ' - cron-git: git push done.')); |