joyskills-cli 0.3.7 → 0.3.8
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 +1 -1
- package/src/commands/install.js +14 -6
package/package.json
CHANGED
package/src/commands/install.js
CHANGED
|
@@ -597,7 +597,9 @@ async function installFromGitUrl(gitUrl, targetDir, options, subPath = '') {
|
|
|
597
597
|
}
|
|
598
598
|
|
|
599
599
|
for (const skill of selectedSkills) {
|
|
600
|
-
|
|
600
|
+
// For Git URL installs with subPath, use the last part of subPath as target name
|
|
601
|
+
const targetName = subPath ? subPath.split('/').pop() : skill.name;
|
|
602
|
+
await installSkillFiles(skill, targetDir, targetName);
|
|
601
603
|
}
|
|
602
604
|
|
|
603
605
|
// Update lockfile only for project-level installation (npm-like behavior)
|
|
@@ -605,7 +607,8 @@ async function installFromGitUrl(gitUrl, targetDir, options, subPath = '') {
|
|
|
605
607
|
const lockfileManager = new LockfileManager(process.cwd());
|
|
606
608
|
await lockfileManager.load();
|
|
607
609
|
for (const skill of selectedSkills) {
|
|
608
|
-
|
|
610
|
+
const targetName = subPath ? subPath.split('/').pop() : skill.name;
|
|
611
|
+
lockfileManager.updateSkill(targetName, {
|
|
609
612
|
version: skill.version || '1.0.0',
|
|
610
613
|
source: 'git',
|
|
611
614
|
repository: gitUrl,
|
|
@@ -691,7 +694,10 @@ async function installFromGitHub(owner, repo, skillPath, targetDir, options) {
|
|
|
691
694
|
|
|
692
695
|
// Install selected skills
|
|
693
696
|
for (const skill of selectedSkills) {
|
|
694
|
-
|
|
697
|
+
// For GitHub installs, use the last part of skillPath as target name
|
|
698
|
+
// e.g., "anthropics/skills/pdf" -> install as "pdf", not "skills/pdf"
|
|
699
|
+
const targetName = skillPath ? skillPath.split('/').pop() : skill.name;
|
|
700
|
+
await installSkillFiles(skill, targetDir, targetName);
|
|
695
701
|
}
|
|
696
702
|
|
|
697
703
|
// Update lockfile only for project-level installation (npm-like behavior)
|
|
@@ -699,7 +705,9 @@ async function installFromGitHub(owner, repo, skillPath, targetDir, options) {
|
|
|
699
705
|
const lockfileManager = new LockfileManager(process.cwd());
|
|
700
706
|
await lockfileManager.load();
|
|
701
707
|
for (const skill of selectedSkills) {
|
|
702
|
-
|
|
708
|
+
// Use the same targetName for lockfile consistency
|
|
709
|
+
const targetName = skillPath ? skillPath.split('/').pop() : skill.name;
|
|
710
|
+
lockfileManager.updateSkill(targetName, {
|
|
703
711
|
version: skill.version || '1.0.0',
|
|
704
712
|
source: 'github',
|
|
705
713
|
repository: `${owner}/${repo}`,
|
|
@@ -904,8 +912,8 @@ function formatSize(bytes) {
|
|
|
904
912
|
return (bytes / (1024 * 1024)).toFixed(1) + 'MB';
|
|
905
913
|
}
|
|
906
914
|
|
|
907
|
-
async function installSkillFiles(skill, targetDir) {
|
|
908
|
-
const targetPath = path.join(targetDir, skill.name);
|
|
915
|
+
async function installSkillFiles(skill, targetDir, targetName = null) {
|
|
916
|
+
const targetPath = path.join(targetDir, targetName || skill.name);
|
|
909
917
|
|
|
910
918
|
if (fs.existsSync(targetPath)) {
|
|
911
919
|
fs.rmSync(targetPath, { recursive: true, force: true });
|