diff options
Diffstat (limited to 'server/tools/import-videos.ts')
-rw-r--r-- | server/tools/import-videos.ts | 17 |
1 files 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 = { | |||
46 | } | 46 | } |
47 | 47 | ||
48 | async function promptPassword () { | 48 | async function promptPassword () { |
49 | return new Promise ( resolve => { | 49 | return new Promise ( res => { |
50 | prompt.start() | 50 | prompt.start() |
51 | const schema = { | 51 | const schema = { |
52 | properties: { | 52 | properties: { |
53 | password: { | 53 | password: { |
54 | hidden:true, | 54 | hidden: true, |
55 | required:true | 55 | required: true |
56 | } | 56 | } |
57 | } | 57 | } |
58 | } | 58 | } |
59 | prompt.get(schema, function(err, result) { | 59 | prompt.get(schema, function (err, result) { |
60 | if (err) { | 60 | if (err) { |
61 | console.log(err.message) | 61 | console.log(err.message) |
62 | return res(); | ||
62 | } | 63 | } |
63 | resolve(result.password) | 64 | return res(result.password) |
64 | }) | 65 | }) |
65 | }) | 66 | }) |
66 | } | 67 | } |
67 | 68 | ||
68 | async function run () { | 69 | async function run () { |
69 | if ( | 70 | if (!user.password) { |
70 | !user.password | 71 | user.password = await promptPassword() |
71 | ) { | ||
72 | user.password = await promptPassword(); | ||
73 | } | 72 | } |
74 | 73 | ||
75 | const res = await getClient(program['url']) | 74 | const res = await getClient(program['url']) |