eskill 1.0.33 → 1.1.0
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/cli.js +1 -1
- package/lib/installer.js +18 -4
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ const program = new Command();
|
|
|
13
13
|
program
|
|
14
14
|
.name('eskill')
|
|
15
15
|
.description('Unified AI Agent Skills Management - Install skills from Git URLs')
|
|
16
|
-
.version('1.0
|
|
16
|
+
.version('1.1.0')
|
|
17
17
|
.option('-g, --global', '使用全局技能目录(~/.eskill/skills/),否则使用当前目录(./.claude/skills/)', false);
|
|
18
18
|
|
|
19
19
|
// 安装命令
|
package/lib/installer.js
CHANGED
|
@@ -366,10 +366,17 @@ async function copyFromGlobal(skillName, options = {}) {
|
|
|
366
366
|
const sourcePath = join(globalSkillsDir, skillName);
|
|
367
367
|
const targetPath = join(localSkillsDir, skillName);
|
|
368
368
|
|
|
369
|
-
//
|
|
369
|
+
// 检查本地是否已存在同名技能
|
|
370
370
|
if (existsSync(targetPath)) {
|
|
371
371
|
if (!force) {
|
|
372
|
-
|
|
372
|
+
console.log(`\n⚠️ 本地已存在技能: ${skillName}`);
|
|
373
|
+
console.log(` 位置: ${targetPath}\n`);
|
|
374
|
+
|
|
375
|
+
const overwrite = await confirmAction('是否强制覆盖已存在的技能?');
|
|
376
|
+
if (!overwrite) {
|
|
377
|
+
console.log('\n已取消安装\n');
|
|
378
|
+
return { success: false, cancelled: true };
|
|
379
|
+
}
|
|
373
380
|
}
|
|
374
381
|
console.log(`删除本地已存在的技能: ${targetPath}`);
|
|
375
382
|
rmSync(targetPath, { recursive: true, force: true });
|
|
@@ -462,10 +469,17 @@ export async function installFromGitUrl(gitUrl, options = {}) {
|
|
|
462
469
|
mkdirSync(skillsDir, { recursive: true });
|
|
463
470
|
}
|
|
464
471
|
|
|
465
|
-
//
|
|
472
|
+
// 检查是否已存在同名技能
|
|
466
473
|
if (existsSync(targetPath)) {
|
|
467
474
|
if (!force) {
|
|
468
|
-
|
|
475
|
+
console.log(`\n⚠️ 技能已存在: ${skillName}`);
|
|
476
|
+
console.log(` 位置: ${targetPath}\n`);
|
|
477
|
+
|
|
478
|
+
const overwrite = await confirmAction('是否强制覆盖已存在的技能?');
|
|
479
|
+
if (!overwrite) {
|
|
480
|
+
console.log('\n已取消安装\n');
|
|
481
|
+
return { success: false, cancelled: true };
|
|
482
|
+
}
|
|
469
483
|
}
|
|
470
484
|
console.log(`删除已存在的技能: ${targetPath}`);
|
|
471
485
|
rmSync(targetPath, { recursive: true, force: true });
|