Skip to content

Commit 84c3b0e

Browse files
committed
ci: fix audo upgrade script
1 parent 4fe63cd commit 84c3b0e

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

scripts/release.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,30 @@ async function release() {
8484
stdio: "inherit",
8585
});
8686
spawn.sync("git", ["push", "origin"], { stdio: "inherit" });
87-
if (
88-
spawn.sync("pnpm", ["publish", "--registry=https://registry.npmjs.org"], {
87+
const res = spawn.sync(
88+
"pnpm",
89+
["publish", "--registry=https://registry.npmjs.org"],
90+
{
8991
stdio: "inherit",
90-
}).status === 1
91-
) {
92-
// 恢复版本号
92+
}
93+
);
94+
if (res.status === 1) {
9395
pkg.version = currentVersion;
9496
fs.writeFileSync(configPath, JSON.stringify(pkg, null, 2));
9597
throw new Error(`invalid publish version: ${targetVersion}`);
9698
}
99+
console.log(res);
100+
101+
// if (
102+
// spawn.sync("pnpm", ["publish", "--registry=https://registry.npmjs.org"], {
103+
// stdio: "inherit",
104+
// }).status === 1
105+
// ) {
106+
// // 恢复版本号
107+
// pkg.version = currentVersion;
108+
// fs.writeFileSync(configPath, JSON.stringify(pkg, null, 2));
109+
// throw new Error(`invalid publish version: ${targetVersion}`);
110+
// }
97111
}
98112

99113
try {

0 commit comments

Comments
 (0)