From 8528f284ce95181b8aedf7bbbc22c73aee22cdff Mon Sep 17 00:00:00 2001 From: yunyingk Date: Sun, 20 Sep 2026 17:28:48 +0800 Subject: [PATCH] Fix run() null return in release script --- scripts/release.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/release.ts b/scripts/release.ts index 16731be..69f03dc 100644 --- a/scripts/release.ts +++ b/scripts/release.ts @@ -51,7 +51,8 @@ console.log("========================================================\n"); function run(cmd: string, options: { cwd?: string; stdio?: "inherit" | "pipe" | "ignore" } = {}) { const stdio = options.stdio ?? "inherit"; try { - return execSync(cmd, { cwd: options.cwd ?? ROOT, encoding: "utf-8", stdio }).trim(); + const out = execSync(cmd, { cwd: options.cwd ?? ROOT, encoding: "utf-8", stdio }); + return out ? out.toString().trim() : ""; } catch (err) { const errorMsg = err instanceof Error ? err.message : String(err); throw new Error(`执行命令失败: ${cmd}\n${errorMsg}`);