From f5426469bb9cc48d7261c30fb409f618952cc091 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 12 Mar 2020 15:37:44 -0400 Subject: [PATCH] only block interaction if env var set resolves #118 --- jslib | 2 +- src/commands/export.command.ts | 2 +- src/commands/unlock.command.ts | 2 +- src/program.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jslib b/jslib index 44b86f5d..b816dddd 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 44b86f5dd028271059b70a00d7878fbb1a06023f +Subproject commit b816ddddff96b53a77620b8b31d6ca699f0a8195 diff --git a/src/commands/export.command.ts b/src/commands/export.command.ts index 18c522bf..27519d99 100644 --- a/src/commands/export.command.ts +++ b/src/commands/export.command.ts @@ -15,7 +15,7 @@ export class ExportCommand { constructor(private cryptoService: CryptoService, private exportService: ExportService) { } async run(password: string, cmd: program.Command): Promise { - const canInteract = process.stdout.isTTY && process.env.BW_NOINTERACTION !== 'true'; + const canInteract = process.env.BW_NOINTERACTION !== 'true'; if ((password == null || password === '') && canInteract) { const answer: inquirer.Answers = await inquirer.createPromptModule({ output: process.stderr })({ type: 'password', diff --git a/src/commands/unlock.command.ts b/src/commands/unlock.command.ts index 8f3e7614..6d7669ef 100644 --- a/src/commands/unlock.command.ts +++ b/src/commands/unlock.command.ts @@ -15,7 +15,7 @@ export class UnlockCommand { private cryptoFunctionService: CryptoFunctionService) { } async run(password: string, cmd: program.Command) { - const canInteract = process.stdout.isTTY && process.env.BW_NOINTERACTION !== 'true'; + const canInteract = process.env.BW_NOINTERACTION !== 'true'; if ((password == null || password === '') && canInteract) { const answer: inquirer.Answers = await inquirer.createPromptModule({ output: process.stderr })({ type: 'password', diff --git a/src/program.ts b/src/program.ts index 249ac65b..9f870809 100644 --- a/src/program.ts +++ b/src/program.ts @@ -645,7 +645,7 @@ export class Program extends BaseProgram { await this.exitIfNotAuthed(); const hasKey = await this.main.cryptoService.hasKey(); if (!hasKey) { - const canInteract = process.stdout.isTTY && process.env.BW_NOINTERACTION !== 'true'; + const canInteract = process.env.BW_NOINTERACTION !== 'true'; if (canInteract) { const command = new UnlockCommand(this.main.cryptoService, this.main.userService, this.main.cryptoFunctionService);