File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -84,16 +84,30 @@ async function release() {
84
84
stdio : "inherit" ,
85
85
} ) ;
86
86
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
+ {
89
91
stdio : "inherit" ,
90
- } ) . status === 1
91
- ) {
92
- // 恢复版本号
92
+ }
93
+ ) ;
94
+ if ( res . status === 1 ) {
93
95
pkg . version = currentVersion ;
94
96
fs . writeFileSync ( configPath , JSON . stringify ( pkg , null , 2 ) ) ;
95
97
throw new Error ( `invalid publish version: ${ targetVersion } ` ) ;
96
98
}
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
+ // }
97
111
}
98
112
99
113
try {
You can’t perform that action at this time.
0 commit comments