eskill 1.2.2 → 1.2.4
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 +14 -6
- 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.2.
|
|
16
|
+
.version('1.2.4')
|
|
17
17
|
.option('-g, --global', '使用全局技能目录(~/.eskill/skills/),否则使用当前目录(./.claude/skills/)', false);
|
|
18
18
|
|
|
19
19
|
// 安装命令
|
package/lib/installer.js
CHANGED
|
@@ -434,7 +434,12 @@ async function copyFromGlobal(skillName, options = {}) {
|
|
|
434
434
|
console.log(` 源: ${sourcePath}`);
|
|
435
435
|
console.log(` 目标: ${targetPath}\n`);
|
|
436
436
|
|
|
437
|
-
|
|
437
|
+
// 使用 -L 选项解引用符号链接,复制实际文件内容
|
|
438
|
+
if (process.platform === 'win32') {
|
|
439
|
+
execSync(`xcopy "${sourcePath}" "${targetPath}" /E /I /H /Y`, { stdio: 'inherit' });
|
|
440
|
+
} else {
|
|
441
|
+
execSync(`cp -rL "${sourcePath}" "${targetPath}"`, { stdio: 'inherit' });
|
|
442
|
+
}
|
|
438
443
|
|
|
439
444
|
// 复制元数据,并标记来源
|
|
440
445
|
const globalMeta = getSkillMeta(skillName, true);
|
|
@@ -485,9 +490,11 @@ function confirmAction(message) {
|
|
|
485
490
|
export async function installFromGitUrl(gitUrl, options = {}) {
|
|
486
491
|
const { agent = 'claude', link = false, force = false, global = false } = options;
|
|
487
492
|
|
|
493
|
+
let actualUrl;
|
|
494
|
+
|
|
488
495
|
try {
|
|
489
496
|
// 检测并处理 name@author 格式
|
|
490
|
-
|
|
497
|
+
actualUrl = await handleSkillAtAuthorFormat(gitUrl, global);
|
|
491
498
|
|
|
492
499
|
// 如果是从全局复制
|
|
493
500
|
if (actualUrl.startsWith('GLOBAL:')) {
|
|
@@ -595,12 +602,13 @@ export async function installFromGitUrl(gitUrl, options = {}) {
|
|
|
595
602
|
console.log(`\n创建符号链接: ${sourcePath} -> ${targetPath}`);
|
|
596
603
|
symlinkSync(sourcePath, targetPath, 'dir');
|
|
597
604
|
} else {
|
|
598
|
-
//
|
|
605
|
+
// 复制文件(使用 -L 选项跟随符号链接,复制实际文件而非链接本身)
|
|
599
606
|
console.log(`\n复制文件到: ${targetPath}`);
|
|
600
607
|
if (process.platform === 'win32') {
|
|
601
608
|
execSync(`xcopy "${sourcePath}" "${targetPath}" /E /I /H /Y`, { stdio: 'inherit' });
|
|
602
609
|
} else {
|
|
603
|
-
|
|
610
|
+
// 使用 -L 选项解引用符号链接,复制实际文件内容
|
|
611
|
+
execSync(`cp -rL "${sourcePath}" "${targetPath}"`, { stdio: 'inherit' });
|
|
604
612
|
}
|
|
605
613
|
}
|
|
606
614
|
|
|
@@ -980,11 +988,11 @@ export async function updateSkill(skillName, options = {}) {
|
|
|
980
988
|
// 删除旧技能
|
|
981
989
|
rmSync(targetPath, { recursive: true, force: true });
|
|
982
990
|
|
|
983
|
-
//
|
|
991
|
+
// 复制新技能(使用 -L 选项解引用符号链接)
|
|
984
992
|
if (process.platform === 'win32') {
|
|
985
993
|
execSync(`xcopy "${sourcePath}" "${targetPath}" /E /I /H /Y`, { stdio: 'inherit' });
|
|
986
994
|
} else {
|
|
987
|
-
execSync(`cp -
|
|
995
|
+
execSync(`cp -rL "${sourcePath}" "${targetPath}"`, { stdio: 'inherit' });
|
|
988
996
|
}
|
|
989
997
|
|
|
990
998
|
// 更新元数据
|