crabatool 1.0.255 → 1.0.270
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/utils.js +21 -7
- package/package.json +2 -1
- package/tool/compress.js +1 -0
- package/tool/upgrade.js +5 -0
package/lib/utils.js
CHANGED
|
@@ -650,20 +650,34 @@ class Utils {
|
|
|
650
650
|
|
|
651
651
|
var webPath = config.webPath || config.targetPath;
|
|
652
652
|
console.log('cd ' + webPath);
|
|
653
|
-
execSync('cd ' + webPath); // 必须切换到web路径,有些是在node_modules路径下
|
|
653
|
+
//execSync('cd ' + webPath, { cwd: webPath }); // 必须切换到web路径,有些是在node_modules路径下
|
|
654
|
+
|
|
655
|
+
var branchName = config.branchName || config.version;
|
|
656
|
+
branchName = branchName.replace('origin/', '');
|
|
657
|
+
|
|
658
|
+
/*
|
|
659
|
+
var list = [];
|
|
660
|
+
list.push('cd ' + webPath);
|
|
661
|
+
list.push('git add --all');
|
|
662
|
+
list.push('git commit -m \"' + msg + '\"');
|
|
663
|
+
list.push('git pull --rebase origin ' + branchName);
|
|
664
|
+
list.push('git push origin ' + branchName);
|
|
665
|
+
var git = list.join(' && ');
|
|
666
|
+
console.log(git);
|
|
667
|
+
execSync(git, { cwd: webPath });
|
|
668
|
+
*/
|
|
654
669
|
|
|
655
670
|
console.log('git add --all'); // 暂存
|
|
656
|
-
execSync('git add --all'); // 暂存
|
|
671
|
+
execSync('git add --all', { cwd: webPath }); // 暂存
|
|
657
672
|
|
|
658
673
|
console.log('git commit -m \"' + msg + '\"'); // 提交日志
|
|
659
|
-
execSync('git commit -m \"' + msg + '\"'); // 提交日志
|
|
674
|
+
execSync('git commit -m \"' + msg + '\"', { cwd: webPath }); // 提交日志
|
|
660
675
|
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
execSync('git pull --rebase origin ' + branchName); // 拉取分支
|
|
676
|
+
//console.log('git pull --rebase origin ' + branchName); // 拉取分支
|
|
677
|
+
//execSync('git pull --rebase origin ' + branchName, { cwd: webPath }); // 拉取分支
|
|
664
678
|
|
|
665
679
|
console.log('git push origin ' + branchName); // 推送
|
|
666
|
-
execSync('git push origin ' + branchName); // 推送
|
|
680
|
+
execSync('git push origin ' + branchName, { cwd: webPath }); // 推送
|
|
667
681
|
}
|
|
668
682
|
|
|
669
683
|
addPackageVersion(packagePath, v1, v2) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "crabatool",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.270",
|
|
4
4
|
"description": "crabatool",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"start": "node run.js",
|
|
11
11
|
"test": "node ./test/test.js",
|
|
12
12
|
"run": "node ./test/test.js -run",
|
|
13
|
+
"export": "node ./test/test.js -exportgspx -webPath F:\\Beefun\\srcs",
|
|
13
14
|
"checkjs": "node ./test/test.js -checkjs",
|
|
14
15
|
"beefun": "node ./test/beefun.js -checkjs",
|
|
15
16
|
"checkUpdate": "node run.js -checkUpdate -version master -webPath F:\\crabaevery\\www",
|
package/tool/compress.js
CHANGED
package/tool/upgrade.js
CHANGED
|
@@ -136,6 +136,7 @@ class Upgrade {
|
|
|
136
136
|
|
|
137
137
|
if (localData.version == newData.version) {
|
|
138
138
|
console.log(':::本地已经是最新版本,不需要更新:::');
|
|
139
|
+
console.log('[crabaversion]没有更新,本地已经是最新版本:' + localData.version);
|
|
139
140
|
if (this.hasLogs()) {
|
|
140
141
|
this.clearLog();
|
|
141
142
|
}
|
|
@@ -148,6 +149,7 @@ class Upgrade {
|
|
|
148
149
|
return;
|
|
149
150
|
}
|
|
150
151
|
|
|
152
|
+
console.log("[crabaversion]" + newData.version);
|
|
151
153
|
this.done = this._updateDone;
|
|
152
154
|
this.downloadCraba();
|
|
153
155
|
}
|
|
@@ -192,6 +194,9 @@ class Upgrade {
|
|
|
192
194
|
});
|
|
193
195
|
var msg = logs.join(';\t');
|
|
194
196
|
|
|
197
|
+
|
|
198
|
+
console.log("[crabaupdatelog]" + msg);
|
|
199
|
+
|
|
195
200
|
utils.gitpush(msg);
|
|
196
201
|
|
|
197
202
|
this.clearLog(); // 每次更新后都要清除标记,避免下次又去更新;
|