ai-developer-skill-os 1.5.0 → 1.5.2
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/bin/install.js +23 -0
- package/package.json +1 -1
package/bin/install.js
CHANGED
|
@@ -24,6 +24,23 @@ function copyRecursiveSync(src, dest) {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
function cleanOldSkills(targetSkillsDir, isGeminiGlobal) {
|
|
28
|
+
if (fs.existsSync(targetSkillsDir)) {
|
|
29
|
+
console.log('🧹 Đang dọn dẹp phiên bản cũ để tối ưu hệ thống...');
|
|
30
|
+
if (isGeminiGlobal) {
|
|
31
|
+
// Chỉ xoá các thư mục qk-* để không ảnh hưởng các skill khác của người dùng
|
|
32
|
+
fs.readdirSync(targetSkillsDir).forEach(item => {
|
|
33
|
+
if (item.startsWith('qk-')) {
|
|
34
|
+
fs.rmSync(path.join(targetSkillsDir, item), { recursive: true, force: true });
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
} else {
|
|
38
|
+
// Xoá sạch toàn bộ thư mục kỹ năng của bộ công cụ này
|
|
39
|
+
fs.rmSync(targetSkillsDir, { recursive: true, force: true });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
27
44
|
const rl = readline.createInterface({
|
|
28
45
|
input: process.stdin,
|
|
29
46
|
output: process.stdout
|
|
@@ -112,6 +129,9 @@ Nếu người dùng sử dụng tham số (argument), bạn BẮT BUỘC phải
|
|
|
112
129
|
fs.mkdirSync(targetDir, { recursive: true });
|
|
113
130
|
}
|
|
114
131
|
|
|
132
|
+
const targetSkillsDir = path.join(targetDir, 'skills');
|
|
133
|
+
cleanOldSkills(targetSkillsDir, isGemini && isGlobal);
|
|
134
|
+
|
|
115
135
|
const filesAndFolders = [
|
|
116
136
|
'skills', '_template', 'docs', 'skills.json', 'README.md', 'CHANGELOG.md', 'LICENSE'
|
|
117
137
|
];
|
|
@@ -121,6 +141,9 @@ Nếu người dùng sử dụng tham số (argument), bạn BẮT BUỘC phải
|
|
|
121
141
|
if (fs.existsSync(path.join(sourceDir, 'skills'))) {
|
|
122
142
|
copyRecursiveSync(path.join(sourceDir, 'skills'), path.join(targetDir, 'skills'));
|
|
123
143
|
}
|
|
144
|
+
if (fs.existsSync(path.join(sourceDir, 'skills.json'))) {
|
|
145
|
+
fs.copyFileSync(path.join(sourceDir, 'skills.json'), path.join(targetDir, 'skills', 'skills.json'));
|
|
146
|
+
}
|
|
124
147
|
} else {
|
|
125
148
|
filesAndFolders.forEach(item => {
|
|
126
149
|
const src = path.join(sourceDir, item);
|
package/package.json
CHANGED