1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

Use stderr for prompts to better allow scripting (#14)

* Update invocations of inquirer.js prompts to output prompt to stderr.

fixes #7

* Updates to use updated typings from @types/inquirer
This commit is contained in:
Keith Kelly
2018-06-18 22:07:45 -04:00
committed by Kyle Spearrin
parent a1b0dcf8fa
commit c7160c0870
5 changed files with 11 additions and 11 deletions

View File

@@ -19,7 +19,7 @@ export class ExportCommand {
async run(password: string, cmd: program.Command): Promise<Response> {
if (password == null || password === '') {
const answer = await inquirer.prompt<any>({
const answer: inquirer.Answers = await inquirer.createPromptModule({ output: process.stderr })({
type: 'password',
name: 'password',
message: 'Master password:',

View File

@@ -22,7 +22,7 @@ export class LoginCommand {
async run(email: string, password: string, cmd: program.Command) {
if (email == null || email === '') {
const answer = await inquirer.prompt<any>({
const answer: inquirer.Answers = await inquirer.createPromptModule({ output: process.stderr })({
type: 'input',
name: 'email',
message: 'Email address:',
@@ -37,7 +37,7 @@ export class LoginCommand {
}
if (password == null || password === '') {
const answer = await inquirer.prompt<any>({
const answer: inquirer.Answers = await inquirer.createPromptModule({ output: process.stderr })({
type: 'password',
name: 'password',
message: 'Master password:',
@@ -89,7 +89,7 @@ export class LoginCommand {
const options = twoFactorProviders.map((p) => p.name);
options.push(new inquirer.Separator());
options.push('Cancel');
const answer = await inquirer.prompt<any>({
const answer: inquirer.Answers = await inquirer.createPromptModule({ output: process.stderr })({
type: 'list',
name: 'method',
message: 'Two-step login method:',
@@ -111,7 +111,7 @@ export class LoginCommand {
}
if (twoFactorToken == null) {
const answer = await inquirer.prompt<any>({
const answer: inquirer.Answers = await inquirer.createPromptModule({ output: process.stderr })({
type: 'input',
name: 'token',
message: 'Two-step login code:',

View File

@@ -16,7 +16,7 @@ export class UnlockCommand {
async run(password: string, cmd: program.Command) {
if (password == null || password === '') {
const answer = await inquirer.prompt<any>({
const answer: inquirer.Answers = await inquirer.createPromptModule({ output: process.stderr })({
type: 'password',
name: 'password',
message: 'Master password:',