mirror of
https://github.com/rohitg00/skillkit.git
synced 2026-11-18 18:04:26 +00:00
feat: quarantine cleanup on failure, federated search by default
- Hoist cloneResult above try block so catch can clean up temp dir on any failure path, not just the happy path - Always include GitHub API in find search results (was behind --federated flag, now default)
This commit is contained in:
@@ -60,8 +60,9 @@ export class FindCommand extends Command {
|
||||
description: "Minimal output (just list skills)",
|
||||
});
|
||||
|
||||
federated = Option.Boolean("--federated,-f", false, {
|
||||
description: "Search external registries (GitHub SKILL.md files)",
|
||||
federated = Option.Boolean("--federated,-f", true, {
|
||||
description: "Search external registries (enabled by default)",
|
||||
hidden: true,
|
||||
});
|
||||
|
||||
async execute(): Promise<number> {
|
||||
@@ -162,9 +163,7 @@ export class FindCommand extends Command {
|
||||
s.start("Searching skills.sh + external registries...");
|
||||
const fedSearch = new FederatedSearch();
|
||||
fedSearch.addRegistry(new SkillsShRegistry());
|
||||
if (this.federated) {
|
||||
fedSearch.addRegistry(new GitHubSkillRegistry());
|
||||
}
|
||||
fedSearch.addRegistry(new GitHubSkillRegistry());
|
||||
try {
|
||||
const fedResult = await fedSearch.search(searchTerm, {
|
||||
limit: parseInt(this.limit, 10) || 10,
|
||||
|
||||
@@ -132,14 +132,17 @@ export class InstallCommand extends Command {
|
||||
const isInteractive =
|
||||
process.stdin.isTTY && !this.skills && !this.all && !this.yes;
|
||||
const s = spinner();
|
||||
let cloneResult: Awaited<ReturnType<typeof this.resolveSource>>["cloneResult"] = null;
|
||||
|
||||
try {
|
||||
if (process.stdin.isTTY && !this.quiet) {
|
||||
welcome();
|
||||
}
|
||||
|
||||
const { providerAdapter, cloneResult } = await this.resolveSource(s);
|
||||
if (!providerAdapter || !cloneResult) return 1;
|
||||
const resolved = await this.resolveSource(s);
|
||||
if (!resolved.providerAdapter || !resolved.cloneResult) return 1;
|
||||
const providerAdapter = resolved.providerAdapter;
|
||||
cloneResult = resolved.cloneResult;
|
||||
|
||||
const discoveredSkills = cloneResult.discoveredSkills || [];
|
||||
|
||||
@@ -175,6 +178,7 @@ export class InstallCommand extends Command {
|
||||
|
||||
return 0;
|
||||
} catch (err) {
|
||||
if (cloneResult) this.cleanupTemp(cloneResult);
|
||||
s.stop(colors.error("Installation failed"));
|
||||
console.log(colors.muted(err instanceof Error ? err.message : String(err)));
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user