1
0
mirror of https://github.com/bitwarden/cli synced 2025-12-11 05:43:20 +00:00

only block interaction if env var set

resolves #118
This commit is contained in:
Kyle Spearrin
2020-03-12 15:37:44 -04:00
parent 3f1d3c7680
commit f5426469bb
4 changed files with 4 additions and 4 deletions

2
jslib

Submodule jslib updated: 44b86f5dd0...b816ddddff

View File

@@ -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',

View File

@@ -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',

View File

@@ -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);