Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Commit

Permalink
only block interaction if env var set
Browse files Browse the repository at this point in the history
resolves #118
  • Loading branch information
kspearrin committed Mar 12, 2020
1 parent 3f1d3c7 commit f542646
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/commands/export.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class ExportCommand {
constructor(private cryptoService: CryptoService, private exportService: ExportService) { }

async run(password: string, cmd: program.Command): Promise<Response> {
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',
Expand Down
2 changes: 1 addition & 1 deletion src/commands/unlock.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f542646

Please sign in to comment.