joyskills-cli 0.3.8 → 0.3.9
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/README.md +1 -1
- package/package.json +1 -1
- package/src/commands/install.js +11 -10
- package/src/commands/upgrade.js +4 -2
package/README.md
CHANGED
package/package.json
CHANGED
package/src/commands/install.js
CHANGED
|
@@ -387,8 +387,9 @@ async function tryInstallFromRegistryDir(skillName, registryDirPath, targetDir,
|
|
|
387
387
|
|
|
388
388
|
if (!skill) return false;
|
|
389
389
|
|
|
390
|
-
// Use
|
|
391
|
-
const
|
|
390
|
+
// Use the last segment of relativePath as target name
|
|
391
|
+
const targetName = skill.relativePath ? skill.relativePath.split('/').pop() : skill.name;
|
|
392
|
+
const targetPath = path.join(targetDir, targetName);
|
|
392
393
|
copyRecursive(skill.path, targetPath);
|
|
393
394
|
|
|
394
395
|
// Get git commit for the skill source
|
|
@@ -398,7 +399,7 @@ async function tryInstallFromRegistryDir(skillName, registryDirPath, targetDir,
|
|
|
398
399
|
if (!options.global) {
|
|
399
400
|
const lockfileManager = new LockfileManager(projectRoot);
|
|
400
401
|
await lockfileManager.load();
|
|
401
|
-
lockfileManager.updateSkill(
|
|
402
|
+
lockfileManager.updateSkill(targetName, {
|
|
402
403
|
version: skill.version || '1.0.0',
|
|
403
404
|
source: sourceLabel,
|
|
404
405
|
commit: commitHash,
|
|
@@ -407,7 +408,7 @@ async function tryInstallFromRegistryDir(skillName, registryDirPath, targetDir,
|
|
|
407
408
|
await lockfileManager.save();
|
|
408
409
|
}
|
|
409
410
|
|
|
410
|
-
console.log(chalk.green(`✅ Installed ${
|
|
411
|
+
console.log(chalk.green(`✅ Installed ${targetName} v${skill.version || '1.0.0'} from ${sourceLabel}`));
|
|
411
412
|
return true;
|
|
412
413
|
}
|
|
413
414
|
}
|
|
@@ -598,7 +599,7 @@ async function installFromGitUrl(gitUrl, targetDir, options, subPath = '') {
|
|
|
598
599
|
|
|
599
600
|
for (const skill of selectedSkills) {
|
|
600
601
|
// For Git URL installs with subPath, use the last part of subPath as target name
|
|
601
|
-
const targetName =
|
|
602
|
+
const targetName = skill.relativePath ? skill.relativePath.split('/').pop() : skill.name;
|
|
602
603
|
await installSkillFiles(skill, targetDir, targetName);
|
|
603
604
|
}
|
|
604
605
|
|
|
@@ -607,7 +608,7 @@ async function installFromGitUrl(gitUrl, targetDir, options, subPath = '') {
|
|
|
607
608
|
const lockfileManager = new LockfileManager(process.cwd());
|
|
608
609
|
await lockfileManager.load();
|
|
609
610
|
for (const skill of selectedSkills) {
|
|
610
|
-
const targetName =
|
|
611
|
+
const targetName = skill.relativePath ? skill.relativePath.split('/').pop() : skill.name;
|
|
611
612
|
lockfileManager.updateSkill(targetName, {
|
|
612
613
|
version: skill.version || '1.0.0',
|
|
613
614
|
source: 'git',
|
|
@@ -694,9 +695,9 @@ async function installFromGitHub(owner, repo, skillPath, targetDir, options) {
|
|
|
694
695
|
|
|
695
696
|
// Install selected skills
|
|
696
697
|
for (const skill of selectedSkills) {
|
|
697
|
-
//
|
|
698
|
-
// e.g., "
|
|
699
|
-
const targetName =
|
|
698
|
+
// Always use the last segment of relativePath as target name
|
|
699
|
+
// e.g., "skills/pdf" -> "pdf", "anthropics/skills/pdf" -> "pdf"
|
|
700
|
+
const targetName = skill.relativePath ? skill.relativePath.split('/').pop() : skill.name;
|
|
700
701
|
await installSkillFiles(skill, targetDir, targetName);
|
|
701
702
|
}
|
|
702
703
|
|
|
@@ -706,7 +707,7 @@ async function installFromGitHub(owner, repo, skillPath, targetDir, options) {
|
|
|
706
707
|
await lockfileManager.load();
|
|
707
708
|
for (const skill of selectedSkills) {
|
|
708
709
|
// Use the same targetName for lockfile consistency
|
|
709
|
-
const targetName =
|
|
710
|
+
const targetName = skill.relativePath ? skill.relativePath.split('/').pop() : skill.name;
|
|
710
711
|
lockfileManager.updateSkill(targetName, {
|
|
711
712
|
version: skill.version || '1.0.0',
|
|
712
713
|
source: 'github',
|
package/src/commands/upgrade.js
CHANGED
|
@@ -328,7 +328,8 @@ async function upgradeFromGitHub(skill, skillsDir) {
|
|
|
328
328
|
}
|
|
329
329
|
|
|
330
330
|
// Remove old version
|
|
331
|
-
const
|
|
331
|
+
const targetName = skillInfo.relativePath ? skillInfo.relativePath.split('/').pop() : skill.name;
|
|
332
|
+
const targetPath = path.join(skillsDir, targetName);
|
|
332
333
|
if (fs.existsSync(targetPath)) {
|
|
333
334
|
fs.rmSync(targetPath, { recursive: true, force: true });
|
|
334
335
|
}
|
|
@@ -373,7 +374,8 @@ async function upgradeFromRegistry(skill, skillsDir) {
|
|
|
373
374
|
}
|
|
374
375
|
|
|
375
376
|
// Remove old version
|
|
376
|
-
const
|
|
377
|
+
const targetName = skillInfo.relativePath ? skillInfo.relativePath.split('/').pop() : skill.name;
|
|
378
|
+
const targetPath = path.join(skillsDir, targetName);
|
|
377
379
|
if (fs.existsSync(targetPath)) {
|
|
378
380
|
fs.rmSync(targetPath, { recursive: true, force: true });
|
|
379
381
|
}
|