crabatool 1.0.132 → 1.0.133

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/tool/install.js +12 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crabatool",
3
- "version": "1.0.132",
3
+ "version": "1.0.133",
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();