]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: avoid unncessary print on release script exit [ci skip]
authorEvan You <yyx990803@gmail.com>
Fri, 20 Oct 2023 03:47:56 +0000 (11:47 +0800)
committerEvan You <yyx990803@gmail.com>
Fri, 20 Oct 2023 03:47:56 +0000 (11:47 +0800)
scripts/release.js

index 400e808ba580cc20cf1f98fab3cf8942a7c14014..a64cba03bfa0d121e80968e8430df9d77f4f1b90 100644 (file)
@@ -9,6 +9,8 @@ import { execa } from 'execa'
 import { createRequire } from 'node:module'
 import { fileURLToPath } from 'node:url'
 
+let versionUpdated = false
+
 const { prompt } = enquirer
 const currentVersion = createRequire(import.meta.url)('../package.json').version
 const __dirname = path.dirname(fileURLToPath(import.meta.url))
@@ -219,6 +221,7 @@ async function main() {
     targetVersion,
     isCanary ? renamePackageToCanary : keepThePackageName
   )
+  versionUpdated = true
 
   // build all packages with types
   step('\nBuilding all packages...')
@@ -418,7 +421,10 @@ async function publishPackage(pkgName, version) {
 }
 
 main().catch(err => {
-  updateVersions(currentVersion)
+  if (versionUpdated) {
+    // revert to current version on failed releases
+    updateVersions(currentVersion)
+  }
   console.error(err)
   process.exit(1)
 })