File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 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'
99import { createRequire } from 'node:module'
1010import { fileURLToPath } from 'node:url'
1111
12+ let versionUpdated = false
13+
1214const { prompt } = enquirer
1315const currentVersion = createRequire ( import . meta. url ) ( '../package.json' ) . version
1416const __dirname = path . dirname ( fileURLToPath ( import . meta. url ) )
@@ -219,6 +221,7 @@ async function main() {
219221 targetVersion ,
220222 isCanary ? renamePackageToCanary : keepThePackageName
221223 )
224+ versionUpdated = true
222225
223226 // build all packages with types
224227 step ( '\nBuilding all packages...' )
@@ -418,7 +421,10 @@ async function publishPackage(pkgName, version) {
418421}
419422
420423main ( ) . catch ( err => {
421- updateVersions ( currentVersion )
424+ if ( versionUpdated ) {
425+ // revert to current version on failed releases
426+ updateVersions ( currentVersion )
427+ }
422428 console . error ( err )
423429 process . exit ( 1 )
424430} )
You can’t perform that action at this time.
0 commit comments