Standard code
This commit is contained in:
parent
066fc8ba71
commit
e2b9d0ca56
1 changed files with 8 additions and 9 deletions
|
@ -46,30 +46,29 @@ const processOptions = {
|
|||
}
|
||||
|
||||
async function promptPassword () {
|
||||
return new Promise ( resolve => {
|
||||
return new Promise ( res => {
|
||||
prompt.start()
|
||||
const schema = {
|
||||
properties: {
|
||||
password: {
|
||||
hidden:true,
|
||||
required:true
|
||||
hidden: true,
|
||||
required: true
|
||||
}
|
||||
}
|
||||
}
|
||||
prompt.get(schema, function(err, result) {
|
||||
prompt.get(schema, function (err, result) {
|
||||
if (err) {
|
||||
console.log(err.message)
|
||||
return res();
|
||||
}
|
||||
resolve(result.password)
|
||||
return res(result.password)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
async function run () {
|
||||
if (
|
||||
!user.password
|
||||
) {
|
||||
user.password = await promptPassword();
|
||||
if (!user.password) {
|
||||
user.password = await promptPassword()
|
||||
}
|
||||
|
||||
const res = await getClient(program['url'])
|
||||
|
|
Loading…
Reference in a new issue