crabatool 1.0.222 → 1.0.230
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 +5 -1
- package/package.json +2 -2
- package/tool/checkjs.js +4 -0
- package/tool/crabapublish.js +1 -1
- package/tool/upgrade.js +10 -6
package/lib/utils.js
CHANGED
|
@@ -71,7 +71,7 @@ class Utils {
|
|
|
71
71
|
for (var i = 0; i < files.length; i++) {
|
|
72
72
|
var fileName = files[i];
|
|
73
73
|
var filePath = utils.join(source, fileName);
|
|
74
|
-
|
|
74
|
+
utils.debug(filePath);
|
|
75
75
|
var stat = fs.statSync(filePath);
|
|
76
76
|
if (stat.isDirectory()) {
|
|
77
77
|
basename = path.basename(fileName);
|
|
@@ -458,6 +458,10 @@ class Utils {
|
|
|
458
458
|
|
|
459
459
|
var files = fs.readdirSync(source);
|
|
460
460
|
files.forEach(function(fileName) {
|
|
461
|
+
if (fileName == 'node_modules') {
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
|
|
461
465
|
var filePath = utils.join(source, fileName);
|
|
462
466
|
// 包含路径或文件名,都忽略掉
|
|
463
467
|
if (options.ignores && (options.ignores.includes(filePath))) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "crabatool",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.230",
|
|
4
4
|
"description": "crabatool",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"checkUpdate": "node run.js -checkUpdate -version master -webPath F:\\crabaevery\\www",
|
|
16
16
|
"upload": "node run.js -upload -version master -Debug true -host http://127.0.0.1:9998 -hidejspath true -targetPath F:\\CarpaNET_NEW",
|
|
17
17
|
"crabaNgp": "node run.js -mergejs -hidejspath true -targetPath F:\\CarpaNET_NEW\\src\\Carpa.Web\\js\\crabaNgp -inNames initMs.js,businessControl.js -outName F:\\CarpaMS\\src\\js\\crabaNgp.js",
|
|
18
|
-
"webPath": "node ./test/test.js -checkjs -webhooks 0 -webPath F:\\
|
|
18
|
+
"webPath": "node ./test/test.js -checkjs -webhooks 0 -webPath F:\\crabaevery\\www -modName crabaevery"
|
|
19
19
|
},
|
|
20
20
|
"author": "wssf",
|
|
21
21
|
"dependencies": {
|
package/tool/checkjs.js
CHANGED
|
@@ -51,6 +51,8 @@ module.exports.start = async function() {
|
|
|
51
51
|
var notUtf8List = [];
|
|
52
52
|
var utf8List = [];
|
|
53
53
|
|
|
54
|
+
utils.debug('开始检测js');
|
|
55
|
+
|
|
54
56
|
// 开始检测
|
|
55
57
|
var pb = new ProgressBar('检查进度', jsFiles.length);
|
|
56
58
|
//jsFiles.forEach(async function(filePath) {
|
|
@@ -59,6 +61,8 @@ module.exports.start = async function() {
|
|
|
59
61
|
var basename = path.basename(filePath);
|
|
60
62
|
if (blackList.includes(basename)) continue;
|
|
61
63
|
|
|
64
|
+
utils.debug(filePath);
|
|
65
|
+
|
|
62
66
|
var byte = fs.readFileSync(filePath);
|
|
63
67
|
var content = byte.toString();
|
|
64
68
|
// eslint检查
|
package/tool/crabapublish.js
CHANGED
|
@@ -91,7 +91,7 @@ function doAutoTest() {
|
|
|
91
91
|
var type = process.env.REMOTE_BUILD != 'no' ? '正式环境' : '临时环境';
|
|
92
92
|
|
|
93
93
|
var msg = new Date().toString() + "\r\n" + config.modName + type + '发版完成。';
|
|
94
|
-
msg += '\r\n
|
|
94
|
+
msg += '\r\n资源包名:' + config.version + '\r\n平台版本:' + pkg.version;
|
|
95
95
|
|
|
96
96
|
if (process.env.REMOTE_BUILD != 'no') {
|
|
97
97
|
utils.postWeebhooks(msg);
|
package/tool/upgrade.js
CHANGED
|
@@ -84,7 +84,7 @@ class Upgrade {
|
|
|
84
84
|
// 如果没有手工记录更新日志,就不需要更新平台,即便是补丁也要手动标记
|
|
85
85
|
var data = response.data;
|
|
86
86
|
if (data.success && data.remark && data.remark.length > 0) {
|
|
87
|
-
console.log(data.remark);
|
|
87
|
+
//console.log(data.remark);
|
|
88
88
|
that.gitLogs = data.remark; // 先记录日志列表
|
|
89
89
|
that.updateCraba(); // 需要更新平台
|
|
90
90
|
that.clearLog(); // 每次更新后都要清除标记,避免下次又去更新;
|
|
@@ -140,6 +140,11 @@ class Upgrade {
|
|
|
140
140
|
if (cb) cb();
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
|
+
if (newData.version == "network error") {
|
|
144
|
+
console.log(':::获取平台版本失败:::');
|
|
145
|
+
if (cb) cb();
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
143
148
|
|
|
144
149
|
this.done = this._updateDone;
|
|
145
150
|
this.downloadCraba();
|
|
@@ -175,15 +180,14 @@ class Upgrade {
|
|
|
175
180
|
|
|
176
181
|
var logs = [];
|
|
177
182
|
this.gitLogs.forEach(function(log, index) {
|
|
178
|
-
logs.push((index + 1) + '
|
|
183
|
+
logs.push((index + 1) + '.【日志】' + log.branch_log + ' 【时间】' + log.create_time);
|
|
179
184
|
});
|
|
180
185
|
|
|
181
186
|
//console.log(config);
|
|
182
187
|
|
|
183
|
-
execSync('
|
|
184
|
-
execSync('git
|
|
185
|
-
execSync('git
|
|
186
|
-
execSync('git push origin ' + (config.branchName || config.version));
|
|
188
|
+
execSync('git add ' + config.webPath);
|
|
189
|
+
execSync('git commit -m \"' + logs.join(';\t') + '\"');
|
|
190
|
+
execSync('git push -u origin ' + (config.branchName || config.version));
|
|
187
191
|
}
|
|
188
192
|
|
|
189
193
|
_updateDone() {
|