-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
55 lines (35 loc) · 1011 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
var shell = require("shelljs");
var fs = require("fs");
if (!shell.which("git")) {
shell.echo("Sorry, this script requires git");
shell.exit(1);
}
shell.echo("git 自动化程序");
function gitAuto() {
shell.exec("git add .");
if (shell.exec('git commit -am "Auto-commit"').code !== 0) {
shell.echo(shell.exec('git commit -am "Auto-commit"').code)
shell.echo("Error: Git commit failed");
// shell.exit(1);
shell.exec("git pull");
shell.exec("git push");
}
shell.exec("git pull");
if (shell.exec("git push").code !== 0) {
shell.echo("Error: Git push failed");
shell.exit(1);
}
shell.exec("git push");
}
// shell.cd("C:projectpsts-gansu-front");
// gitAuto();
// shell.cd("C:\project\psts-jiangxi-front");
// gitAuto();
shell.cd("C:/project/psts-liaoning-front");
gitAuto();
// shell.cd("C:\project\psts-nmg-front");
// gitAuto();
// shell.cd("C:\project\psts-shanxi01-front");
// gitAuto();
// shell.cd("C:\project\psts-zj-front");
// gitAuto();