crabatool 1.0.277 → 1.0.280

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/index.js CHANGED
@@ -104,6 +104,7 @@ function checkFast(args) {
104
104
  start.bindAndCheckConfig('-inNames');
105
105
  start.bindAndCheckConfig('-outName');
106
106
  start.bindAndCheckConfig('-targetPath');
107
+ start.bindAndCheckConfig('-exp');
107
108
  require('./tool/compress.js').mergeJs(); // 打包压缩js和css
108
109
  return false;
109
110
  }
package/lib/server.js CHANGED
@@ -62,5 +62,7 @@ server.listen(config.port, hostname, () => {
62
62
  }
63
63
 
64
64
  utils.log(`Server running at ${url}`);
65
- utils.openProcess(url);
65
+ if (!config.noOpen) {
66
+ utils.openProcess(url);
67
+ }
66
68
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crabatool",
3
- "version": "1.0.277",
3
+ "version": "1.0.280",
4
4
  "description": "crabatool",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -85,10 +85,23 @@ function buildFolder(options) {
85
85
  });
86
86
 
87
87
  if (options.__filesContent.length > 0) {
88
+ var content = options.__filesContent.join('\r\n');
89
+
90
+ // 替换变量
91
+ if (config.exp) {
92
+ var list = config.exp.split(';');
93
+ list.forEach(function(item) {
94
+ var arr = item.split('=');
95
+ var key = arr[0].trim();
96
+ var value = arr[1].trim();
97
+ content = content.replaceAll(key, value);
98
+ });
99
+ }
100
+
88
101
  var fileOutPath = options.outPath;
89
102
  fileOutPath = getAbsPath(fileOutPath);
90
103
  utils.mkdirsSync(fileOutPath);
91
- fs.writeFileSync(fileOutPath, __bom + options.__filesContent.join('\r\n'), 'utf8'); // "\ufeff"->> utf-8 BOM标记
104
+ fs.writeFileSync(fileOutPath, __bom + content, 'utf8'); // "\ufeff"->> utf-8 BOM标记
92
105
  utils.debug("打包文件成功:" + fileOutPath);
93
106
  }
94
107
  }
package/tool/start.js CHANGED
@@ -75,14 +75,14 @@ class Start {
75
75
 
76
76
  initArgs() {
77
77
  var keys = [
78
- { name: '-webPath', type: '' },
79
- { name: '-port', type: '' },
80
- { name: '-modName', type: '' },
81
- { name: '-webhooks', type: '' },
82
- { name: '-progress', type: '' },
83
- { name: '-host', type: '' },
84
- { name: '-version', type: '' },
85
- { name: '-branchName', type: '' },
78
+ { name: '-webPath', type: '' }, // 网站路径
79
+ { name: '-port', type: '' }, // 网站端口
80
+ { name: '-modName', type: '' }, // ngp的服务、模块名称
81
+ { name: '-webhooks', type: '' }, // 检测报告推送的地址
82
+ { name: '-progress', type: '' }, // 是否显示检测进度条
83
+ { name: '-host', type: '' }, // 配置crabatool依赖的服务地址,切换服务用
84
+ { name: '-version', type: '' }, // 配置更新平台的版本
85
+ { name: '-branchName', type: '' }, // 配置更新平台的分支名
86
86
  { name: '-abortUrl', type: '' },
87
87
 
88
88
  { name: '-ignoreCheck', type: 'array' },
@@ -94,6 +94,7 @@ class Start {
94
94
  { name: '-Debug', type: 'boolean' },
95
95
  { name: '-checkgspx', type: 'boolean' },
96
96
  { name: '-checkutf8', type: 'boolean' },
97
+
97
98
  { name: '-proxy', type: 'json' },
98
99
  { name: '-proxySrc', type: '' }
99
100
  ];