Fix run() null return in release script
🧪 CI / 🧪 Test, Type-Check & Build Validation (push) Has been cancelled
🧪 CI / 🧪 Test, Type-Check & Build Validation (push) Has been cancelled
This commit is contained in:
1 parent
7f862e3ce7
commit
8528f284ce
1 file changed
+2
-1
+2
-1
@@ -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}`);
|
||||
|
||||
Reference in new issue
Block a user