Browse Source

AUTO_CONFIRM env and replace README

Leszek Wiesner 3 years ago
parent
commit
620f4b7096
2 changed files with 270 additions and 359 deletions
  1. 264 358
      cli/README.md
  2. 6 1
      cli/src/base/AccountsCommandBase.ts

File diff suppressed because it is too large
+ 264 - 358
cli/README.md


+ 6 - 1
cli/src/base/AccountsCommandBase.ts

@@ -181,8 +181,13 @@ export default abstract class AccountsCommandBase extends ApiCommandBase {
     message = 'Are you sure you want to execute this action?',
     defaultVal = false
   ): Promise<void> {
+    if (process.env.AUTO_CONFIRM === 'true' || parseInt(process.env.AUTO_CONFIRM || '')) {
+      return
+    }
     const { confirmed } = await inquirer.prompt([{ type: 'confirm', name: 'confirmed', message, default: defaultVal }])
-    if (!confirmed) this.exit(ExitCodes.OK)
+    if (!confirmed) {
+      this.exit(ExitCodes.OK)
+    }
   }
 
   async promptForAccount(

Some files were not shown because too many files changed in this diff