Browse Source

chore: add confirmation step when generating the changelog

Kia King Ishii 4 years ago
parent
commit
8d2ba4dc95
1 changed files with 12 additions and 2 deletions
  1. 12 2
      scripts/release.js

+ 12 - 2
scripts/release.js

@@ -56,13 +56,13 @@ async function main() {
 
 
   console.log(tag)
   console.log(tag)
 
 
-  const { yes } = await prompt({
+  const { yes: tagOk } = await prompt({
     type: 'confirm',
     type: 'confirm',
     name: 'yes',
     name: 'yes',
     message: `Releasing v${targetVersion} with the "${tag}" tag. Confirm?`
     message: `Releasing v${targetVersion} with the "${tag}" tag. Confirm?`
   })
   })
 
 
-  if (!yes) {
+  if (!tagOk) {
     return
     return
   }
   }
 
 
@@ -82,6 +82,16 @@ async function main() {
   step('\nGenerating the changelog...')
   step('\nGenerating the changelog...')
   await run('yarn', ['changelog'])
   await run('yarn', ['changelog'])
 
 
+  const { yes: changelogOk } = await prompt({
+    type: 'confirm',
+    name: 'yes',
+    message: `Changelog generated. Does it look good?`
+  })
+
+  if (!changelogOk) {
+    return
+  }
+
   // Commit changes to the Git.
   // Commit changes to the Git.
   step('\nCommitting changes...')
   step('\nCommitting changes...')
   await run('git', ['add', '-A'])
   await run('git', ['add', '-A'])