File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ import { execa } from 'execa'
9
9
import { createRequire } from 'node:module'
10
10
import { fileURLToPath } from 'node:url'
11
11
12
+ let versionUpdated = false
13
+
12
14
const { prompt } = enquirer
13
15
const currentVersion = createRequire ( import . meta. url ) ( '../package.json' ) . version
14
16
const __dirname = path . dirname ( fileURLToPath ( import . meta. url ) )
@@ -219,6 +221,7 @@ async function main() {
219
221
targetVersion ,
220
222
isCanary ? renamePackageToCanary : keepThePackageName
221
223
)
224
+ versionUpdated = true
222
225
223
226
// build all packages with types
224
227
step ( '\nBuilding all packages...' )
@@ -418,7 +421,10 @@ async function publishPackage(pkgName, version) {
418
421
}
419
422
420
423
main ( ) . catch ( err => {
421
- updateVersions ( currentVersion )
424
+ if ( versionUpdated ) {
425
+ // revert to current version on failed releases
426
+ updateVersions ( currentVersion )
427
+ }
422
428
console . error ( err )
423
429
process . exit ( 1 )
424
430
} )
You can’t perform that action at this time.
0 commit comments