From 601644b8a7058187e050d2be45f9e2bec293d694 Mon Sep 17 00:00:00 2001 From: chenbaowang <49091147+Rsweater@users.noreply.github.com> Date: Thu, 16 Apr 2026 14:46:55 +0800 Subject: [PATCH] fix(cli): fix addToLock namespace doubling, update fallback path, and download stream completion - install: use actualSlug instead of raw slug in addToLock to prevent namespace doubling (vision2group/vision2group/slug) - update: remove hardcoded 'node dist/cli.mjs' fallback, rely on process.argv[1] which is always reliable - download: use finished() to ensure stream write completes before proceeding --- skillhub-cli/src/commands/download.ts | 3 ++- skillhub-cli/src/commands/install.ts | 4 ++-- skillhub-cli/src/commands/update.ts | 5 +---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/skillhub-cli/src/commands/download.ts b/skillhub-cli/src/commands/download.ts index 8e963e6a..8b6e27d7 100644 --- a/skillhub-cli/src/commands/download.ts +++ b/skillhub-cli/src/commands/download.ts @@ -1,6 +1,7 @@ import { Command } from "commander"; import { createWriteStream } from "node:fs"; import { resolve } from "node:path"; +import { finished } from "node:stream/promises"; import { ApiClient } from "../core/api-client.js"; import { ApiRoutes } from "../schema/routes.js"; import { loadConfig } from "../core/config.js"; @@ -57,7 +58,7 @@ export function registerDownload(program: Command) { const outPath = resolve(outputDir, `${skillSlug}.zip`); const fileStream = createWriteStream(outPath); - await body.pipe(fileStream); + await finished(body.pipe(fileStream)); spinner.succeed(`Downloaded ${skillSlug} to ${outPath}`); } catch (e: any) { diff --git a/skillhub-cli/src/commands/install.ts b/skillhub-cli/src/commands/install.ts index 840ecf57..1217308e 100644 --- a/skillhub-cli/src/commands/install.ts +++ b/skillhub-cli/src/commands/install.ts @@ -468,9 +468,9 @@ async function installFromRegistry(slug: string, opts: Record