crabatool 1.0.36 → 1.0.38

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
@@ -45,6 +45,7 @@ function checkConfig() {
45
45
  bindConfigByArgv('-modName');
46
46
  bindConfigByArgv('-ignoreCheck');
47
47
  bindConfigByArgv('-webhooks');
48
+ bindConfigByArgv('-progress');
48
49
 
49
50
  if (config.ignoreCheck && typeof config.ignoreCheck == 'string') {
50
51
  config.ignoreCheck = config.ignoreCheck.split(',');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crabatool",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "description": "crabatool",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/test/readme.md CHANGED
@@ -16,3 +16,16 @@
16
16
  6. 更新或安装本地 IDEA\VSCode 的新建页面模板;
17
17
  7. 新建空白项目和 ngp 项目;
18
18
  8. 根据配置将当前项目所有业务 js 文件统一打包、es6 语法转换、文件合并;
19
+
20
+ echo "运行平台助手进行 js 代码检测"
21
+ sourceRoot=/opt/jenkins/jenkins/workspace/$appname
22
+ cd $sourceRoot/crabatool
23
+
24
+ echo "nodejs 版本"
25
+ node -v
26
+
27
+ echo "更新平台助手"
28
+ npm update
29
+
30
+ echo "执行代码检测,并统一推送检测报告到钉钉和文档服务器"
31
+ node craba.js -checkjs -progress 0 -webPath $sourceRoot/web/src/main/resources/static/$server -modName shell -webhooks https://oapi.dingtalk.com/robot/send?access_token=37279df60e03ebf25e8eb71230ddb93fe74de99951a8d635d0458e60bfcd44d8
package/test/test.js CHANGED
@@ -34,7 +34,7 @@ var config = {
34
34
  ignoreCompress: true,
35
35
 
36
36
  // 用于保存检查报告的api
37
- reportHost: 'http://127.0.0.1:9998',
37
+ reportHost: 'http://crabadoc.ca.com',
38
38
 
39
39
  // 配置js语法检测报告推送地址
40
40
  webhooks: 'https://oapi.dingtalk.com/robot/send?access_token=ce27b1b1540881540d44c0bd05ba738d865363758892ede137dc1020bd36bd5a' //'https://oapi.dingtalk.com/robot/send?access_token=37279df60e03ebf25e8eb71230ddb93fe74de99951a8d635d0458e60bfcd44d8'
@@ -1,5 +1,6 @@
1
1
  // 这里用到一个很实用的 npm 模块,用以在同一行打印文本
2
2
  var slog = require('single-line-log').stdout;
3
+ var config = require('../lib/config.js');
3
4
 
4
5
  // 封装的 ProgressBar 工具
5
6
  function ProgressBar(description, bar_length) {
@@ -12,6 +13,8 @@ function ProgressBar(description, bar_length) {
12
13
 
13
14
  // 刷新进度条图案、文字的方法
14
15
  that.render = function(opts) {
16
+ if (config.progress == 0) return;
17
+
15
18
  if (!opts.total) opts.total = this.length;
16
19
  that.value = opts.value;
17
20
  var percent = (opts.value / opts.total).toFixed(4); // 计算进度(子任务的 完成数 除以 总数)
package/test/package.json DELETED
@@ -1,15 +0,0 @@
1
- {
2
- "name": "ngptool",
3
- "version": "1.0.0",
4
- "description": "ngptool",
5
- "main": "ngp.js",
6
- "scripts": {
7
- "start": "node ngp.js"
8
- },
9
- "author": {
10
- "name": "wssf"
11
- },
12
- "dependencies": {
13
- "crabatool": "^1.0.0"
14
- }
15
- }