@catcuts-skills/hello-world 1.0.5 → 1.0.6
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": "@catcuts-skills/hello-world",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "简单的 Hello World 示例技能,用于验证技能安装是否成功。显示欢迎信息、环境信息和使用示例。",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
"test": "node scripts/install-skill.js --dry-run",
|
|
10
10
|
"install:global": "node scripts/install-skill.js --global",
|
|
11
11
|
"install:local": "node scripts/install-skill.js --local",
|
|
12
|
+
"uninstall:global": "node scripts/uninstall-skill.js --global",
|
|
13
|
+
"uninstall:local": "node scripts/uninstall-skill.js --local",
|
|
12
14
|
"lint": "echo 'Add your linting commands here'"
|
|
13
15
|
},
|
|
14
16
|
"files": [
|
|
@@ -53,7 +53,7 @@ function log(message, type = 'info') {
|
|
|
53
53
|
function safeRemovePath(filePath, description) {
|
|
54
54
|
try {
|
|
55
55
|
if (!fs.existsSync(filePath)) {
|
|
56
|
-
return { success: true, removed: false, message:
|
|
56
|
+
return { success: true, removed: false, message: `已不存在:${description}(${filePath})` };
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
const stats = fs.lstatSync(filePath);
|
|
@@ -65,32 +65,32 @@ function safeRemovePath(filePath, description) {
|
|
|
65
65
|
return {
|
|
66
66
|
success: true,
|
|
67
67
|
removed: true,
|
|
68
|
-
message: `已删除符号链接: ${description}`
|
|
68
|
+
message: `已删除符号链接: ${description}(${filePath})`
|
|
69
69
|
};
|
|
70
70
|
} else if (isDir) {
|
|
71
71
|
fs.rmSync(filePath, { recursive: true, force: true });
|
|
72
72
|
return {
|
|
73
73
|
success: true,
|
|
74
74
|
removed: true,
|
|
75
|
-
message: `已删除目录: ${description}`
|
|
75
|
+
message: `已删除目录: ${description}(${filePath})`
|
|
76
76
|
};
|
|
77
77
|
} else {
|
|
78
78
|
fs.unlinkSync(filePath);
|
|
79
79
|
return {
|
|
80
80
|
success: true,
|
|
81
81
|
removed: true,
|
|
82
|
-
message: `已删除文件: ${description}`
|
|
82
|
+
message: `已删除文件: ${description}(${filePath})`
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
} catch (error) {
|
|
86
86
|
// 忽略"文件不存在"错误,可能已被并发删除
|
|
87
87
|
if (error.code === 'ENOENT') {
|
|
88
|
-
return { success: true, removed: false, message:
|
|
88
|
+
return { success: true, removed: false, message: `已不存在:${description}(${filePath})` };
|
|
89
89
|
}
|
|
90
90
|
return {
|
|
91
91
|
success: false,
|
|
92
92
|
removed: false,
|
|
93
|
-
message: `删除失败: ${error.message}`
|
|
93
|
+
message: `删除失败: ${description}(${filePath}) - ${error.message}`
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
96
|
}
|