1
0
mirror of https://github.com/bitwarden/cli synced 2025-12-18 01:03:13 +00:00

switch from readline sync to inquirer

This commit is contained in:
Kyle Spearrin
2018-05-23 11:16:23 -04:00
parent 8207e703ac
commit 200effe772
5 changed files with 336 additions and 37 deletions

View File

@@ -1,7 +1,7 @@
import * as program from 'commander';
import * as fs from 'fs';
import * as inquirer from 'inquirer';
import * as path from 'path';
import * as readline from 'readline-sync';
import { CryptoService } from 'jslib/abstractions/crypto.service';
import { ExportService } from 'jslib/abstractions/export.service';
@@ -19,10 +19,13 @@ export class ExportCommand {
async run(password: string, cmd: program.Command): Promise<Response> {
if (password == null || password === '') {
password = readline.question('Master password: ', {
hideEchoBack: true,
const answer = await inquirer.prompt<any>({
type: 'password',
name: 'password',
message: 'Master password:',
mask: '*',
});
password = answer.password;
}
if (password == null || password === '') {
return Response.badRequest('Master password is required.');