filecat 5.31.1 → 5.31.3

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": "filecat",
3
- "version": "5.31.1",
3
+ "version": "5.31.3",
4
4
  "description": "FileCat Server Manager",
5
5
  "author": "xiaobaidadada",
6
6
  "scripts": {
@@ -37,6 +37,22 @@ function removeDirSafe(dir) {
37
37
  console.log("已删除目录:", dir);
38
38
  }
39
39
  }
40
+ function clearDirSafe(dir) {
41
+ if (!fs.existsSync(dir)) return;
42
+
43
+ const files = fs.readdirSync(dir);
44
+
45
+ for (const file of files) {
46
+ const fullPath = path.join(dir, file);
47
+
48
+ try {
49
+ fs.rmSync(fullPath, { recursive: true, force: true });
50
+ console.log("已删除:", fullPath);
51
+ } catch (e) {
52
+ console.error("删除失败:", fullPath, e.message);
53
+ }
54
+ }
55
+ }
40
56
 
41
57
  // =====================
42
58
  // 安全删除文件
@@ -94,7 +110,7 @@ ws.query(shortcutPath, (err, options) => {
94
110
  try {
95
111
 
96
112
  // 删除安装目录
97
- removeDirSafe(installDir);
113
+ clearDirSafe(installDir);
98
114
 
99
115
  // 删除开始菜单快捷方式
100
116
  removeFileSafe(shortcutPath);