From e2b9d0ca5665b05997b1051fb434226b75664fcb Mon Sep 17 00:00:00 2001 From: John Livingston Date: Fri, 11 May 2018 10:31:15 +0200 Subject: Standard code --- server/tools/import-videos.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/server/tools/import-videos.ts b/server/tools/import-videos.ts index 91b897976..b0f7f7d4f 100644 --- a/server/tools/import-videos.ts +++ b/server/tools/import-videos.ts @@ -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']) -- cgit v1.2.3