Skip to content

Commit e5844aa

Browse files
committed
chore: avoid unncessary print on release script exit [ci skip]
1 parent 9058853 commit e5844aa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scripts/release.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { execa } from 'execa'
99
import { createRequire } from 'node:module'
1010
import { fileURLToPath } from 'node:url'
1111

12+
let versionUpdated = false
13+
1214
const { prompt } = enquirer
1315
const currentVersion = createRequire(import.meta.url)('../package.json').version
1416
const __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

420423
main().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
})

0 commit comments

Comments
 (0)