joyskills-cli 0.2.9 → 0.2.10
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 +16 -0
- package/src/commands/remove.js +2 -1
- package/src/commands/upgrade.js +7 -4
package/package.json
CHANGED
package/src/commands/install.js
CHANGED
|
@@ -377,6 +377,14 @@ async function installFromGitUrl(gitUrl, targetDir, options) {
|
|
|
377
377
|
console.log(chalk.green(' ✓ Repository cloned'));
|
|
378
378
|
} else {
|
|
379
379
|
console.log(chalk.gray(' Using cached repository'));
|
|
380
|
+
// Try to update cache
|
|
381
|
+
try {
|
|
382
|
+
const git = simpleGit(cachePath);
|
|
383
|
+
await git.pull('origin', 'main', ['--depth', '1']);
|
|
384
|
+
console.log(chalk.gray(' ✓ Cache updated'));
|
|
385
|
+
} catch (e) {
|
|
386
|
+
// Ignore update errors, use cached version
|
|
387
|
+
}
|
|
380
388
|
}
|
|
381
389
|
|
|
382
390
|
const skills = await findSkills(cachePath);
|
|
@@ -439,6 +447,14 @@ async function installFromGitHub(owner, repo, skillPath, targetDir, options) {
|
|
|
439
447
|
console.log(chalk.green(' ✓ Repository cloned'));
|
|
440
448
|
} else {
|
|
441
449
|
console.log(chalk.gray(' Using cached repository'));
|
|
450
|
+
// Try to update cache
|
|
451
|
+
try {
|
|
452
|
+
const git = simpleGit(cachePath);
|
|
453
|
+
await git.pull('origin', 'main', ['--depth', '1']);
|
|
454
|
+
console.log(chalk.gray(' ✓ Cache updated'));
|
|
455
|
+
} catch (e) {
|
|
456
|
+
// Ignore update errors, use cached version
|
|
457
|
+
}
|
|
442
458
|
}
|
|
443
459
|
|
|
444
460
|
// Find skills in the repo
|
package/src/commands/remove.js
CHANGED
|
@@ -23,7 +23,8 @@ export function removeCommand(program) {
|
|
|
23
23
|
program
|
|
24
24
|
.command('remove <skill>')
|
|
25
25
|
.description('Remove a skill')
|
|
26
|
-
.
|
|
26
|
+
.option('-y, --yes', 'Skip confirmation prompt')
|
|
27
|
+
.action(async (skillName, options) => {
|
|
27
28
|
const projectRoot = process.cwd();
|
|
28
29
|
const lockfileManager = new LockfileManager(projectRoot);
|
|
29
30
|
|
package/src/commands/upgrade.js
CHANGED
|
@@ -269,9 +269,12 @@ async function upgradeFromGitHub(skill, skillsDir) {
|
|
|
269
269
|
const git = simpleGit(cachePath);
|
|
270
270
|
await git.pull();
|
|
271
271
|
|
|
272
|
-
// Find skill in cache
|
|
273
|
-
const
|
|
274
|
-
|
|
272
|
+
// Find skill in cache (support nested directories)
|
|
273
|
+
const { findSkills } = await import('../commands/install.js');
|
|
274
|
+
const skills = await findSkills(cachePath);
|
|
275
|
+
const skillInfo = skills.find(s => s.name === skill.name);
|
|
276
|
+
|
|
277
|
+
if (!skillInfo) {
|
|
275
278
|
throw new Error(`Skill not found in repository: ${skill.name}`);
|
|
276
279
|
}
|
|
277
280
|
|
|
@@ -282,7 +285,7 @@ async function upgradeFromGitHub(skill, skillsDir) {
|
|
|
282
285
|
}
|
|
283
286
|
|
|
284
287
|
// Copy new version
|
|
285
|
-
copyRecursive(
|
|
288
|
+
copyRecursive(skillInfo.path, targetPath);
|
|
286
289
|
}
|
|
287
290
|
|
|
288
291
|
async function upgradeFromRegistry(skill, skillsDir) {
|