update.js 421 字节
Newer Older
W
wizardforcel 已提交
1
var process = require('child_process');
W
wizardforcel 已提交
2
var moment = require('moment')
W
wizardforcel 已提交
3

W
wizardforcel 已提交
4
var tmstr = moment().format('YYYY-MM-DD HH:mm:ss')
W
wizardforcel 已提交
5 6
var cmds = [
    'git add -A',
W
wizardforcel 已提交
7
    'git commit -m "' + tmstr + '"',
W
wizardforcel 已提交
8 9 10 11 12 13
    'git push',
    'hexo clean',
    'hexo g -d'
];

for(var cmd of cmds) {
W
wizardforcel 已提交
14 15 16 17 18 19
    try {
        console.log(cmd);
        console.log(process.execSync(cmd).toString());
    } catch(ex) {
        console.log(ex.toString());
    }
W
wizardforcel 已提交
20
}