Fix run() null return in release script
🧪 CI / 🧪 Test, Type-Check & Build Validation (push) Has been cancelled

This commit is contained in:
gitea committed 2026-09-20 17:28:48 +08:00
1 parent 7f862e3ce7
commit 8528f284ce
1 file changed
+2 -1
+2 -1
View File
@@ -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}`);