Standard code

pull/559/head
John Livingston 2018-05-11 10:31:15 +02:00 committed by Chocobozzz
parent 066fc8ba71
commit e2b9d0ca56
1 changed files with 8 additions and 9 deletions

View File

@ -46,7 +46,7 @@ const processOptions = {
} }
async function promptPassword () { async function promptPassword () {
return new Promise ( resolve => { return new Promise ( res => {
prompt.start() prompt.start()
const schema = { const schema = {
properties: { properties: {
@ -59,17 +59,16 @@ async function promptPassword () {
prompt.get(schema, function (err, result) { prompt.get(schema, function (err, result) {
if (err) { if (err) {
console.log(err.message) console.log(err.message)
return res();
} }
resolve(result.password) return res(result.password)
}) })
}) })
} }
async function run () { async function run () {
if ( if (!user.password) {
!user.password user.password = await promptPassword()
) {
user.password = await promptPassword();
} }
const res = await getClient(program['url']) const res = await getClient(program['url'])