1
0
Fork 0
This commit is contained in:
John Livingston 2018-05-11 11:26:50 +02:00 committed by Chocobozzz
parent 7eb5f8cd32
commit 8a2db2e8cb
1 changed files with 18 additions and 18 deletions

View File

@ -39,29 +39,29 @@ run().catch(err => console.error(err))
let accessToken: string
let client: { id: string, secret: string }
const processOptions = {
cwd: __dirname,
maxBuffer: Infinity
}
async function promptPassword () {
return new Promise ( (res, rej) => {
prompt.start()
const schema = {
properties: {
password: {
hidden: true,
required: true
}
}
}
prompt.get(schema, function (err, result) {
if (err) {
return rej(err);
}
return res(result.password)
})
return new Promise((res, rej) => {
prompt.start()
const schema = {
properties: {
password: {
hidden: true,
required: true
}
}
}
prompt.get(schema, function (err, result) {
if (err) {
return rej(err)
}
return res(result.password)
})
})
}
@ -69,7 +69,7 @@ async function run () {
if (!user.password) {
user.password = await promptPassword()
}
const res = await getClient(program['url'])
client = {
id: res.body.client_id,