crabatool 1.0.132 → 1.0.134

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crabatool",
3
- "version": "1.0.132",
3
+ "version": "1.0.134",
4
4
  "description": "crabatool",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/tool/install.js CHANGED
@@ -65,7 +65,18 @@ class Install {
65
65
  // 第3步:gspx语法高亮
66
66
  var fileTypes = path.join(ideaPath, "options/filetypes.xml");
67
67
  if (!fs.existsSync(fileTypes)) {
68
- console.log("找不到文件:" + fileTypes);
68
+ var xml = `<application>
69
+ <component name="FileTypeManager" version="18">
70
+ <extensionMap>
71
+ <mapping ext="space.kts" type="Kotlin" />
72
+ <mapping ext="gradle.kts" type="Kotlin" />
73
+ <mapping ext="main.kts" type="Kotlin" />
74
+ <mapping ext="bat" type="PLAIN_TEXT" />
75
+ <mapping ext="gspx" type="XML" />
76
+ </extensionMap>
77
+ </component>
78
+ </application>`;
79
+ fs.writeFileSync(fileTypes, xml);
69
80
  return;
70
81
  }
71
82
  var xml = fs.readFileSync(fileTypes).toString();
package/tool/start.js CHANGED
@@ -87,13 +87,10 @@ class Start {
87
87
  //bindConfigByArgv('-branchName');
88
88
  }
89
89
 
90
- checkPath() {
90
+ checkWebPath() {
91
91
  if (!config.webPath) {
92
92
  throw new Error('请检查craba.js,必须告诉工具当前项目的前端路径地址,填绝对路径哦');
93
93
  }
94
- if (!config.port) {
95
- throw new Error('请检查craba.js,必须告诉工具当前项目前端服务器端口地址哦');
96
- }
97
94
 
98
95
  // 支持相对路径
99
96
  if (!path.isAbsolute(config.webPath)) {
@@ -103,12 +100,20 @@ class Start {
103
100
  config.webPath = utils.join(config.webPath);
104
101
  }
105
102
 
103
+ bindBranchName();
104
+ }
105
+
106
+ checkPath() {
107
+ start.checkWebPath();
108
+
109
+ if (!config.port) {
110
+ throw new Error('请检查craba.js,必须告诉工具当前项目前端服务器端口地址哦');
111
+ }
112
+
106
113
  if (!fs.existsSync(config.webPath)) {
107
114
  throw new Error(`请检查craba.js,配置的webPath路径不存在,支持相对路径,路径中用\\双斜杠或单反斜杠/;请检查拼写是否正确:${config.webPath}`);;
108
115
  }
109
116
 
110
- bindBranchName();
111
-
112
117
  start.checkCraba();
113
118
  }
114
119
 
@@ -171,7 +176,7 @@ class Start {
171
176
 
172
177
  // 校验项目js语法
173
178
  checkAllJs() {
174
- start.checkPath();
179
+ start.checkWebPath(); // 兼容老平台
175
180
  require('./checkjs.js').start();
176
181
  }
177
182