fix reject

This commit is contained in:
John Livingston 2018-05-11 10:59:02 +02:00 committed by Chocobozzz
parent e2b9d0ca56
commit 7eb5f8cd32
1 changed files with 2 additions and 3 deletions

View File

@ -46,7 +46,7 @@ const processOptions = {
}
async function promptPassword () {
return new Promise ( res => {
return new Promise ( (res, rej) => {
prompt.start()
const schema = {
properties: {
@ -58,8 +58,7 @@ async function promptPassword () {
}
prompt.get(schema, function (err, result) {
if (err) {
console.log(err.message)
return res();
return rej(err);
}
return res(result.password)
})