aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/import-videos.ts
diff options
context:
space:
mode:
authorJohn Livingston <git@john-livingston.fr>2018-05-11 10:31:15 +0200
committerChocobozzz <me@florianbigard.com>2018-05-11 15:23:50 +0200
commite2b9d0ca5665b05997b1051fb434226b75664fcb (patch)
tree013e2ccd961a333121e70d99fd4e4120211d2163 /server/tools/import-videos.ts
parent066fc8ba71fa3573d1b1fb4c692b8f51c17111fc (diff)
downloadPeerTube-e2b9d0ca5665b05997b1051fb434226b75664fcb.tar.gz
PeerTube-e2b9d0ca5665b05997b1051fb434226b75664fcb.tar.zst
PeerTube-e2b9d0ca5665b05997b1051fb434226b75664fcb.zip
Standard code
Diffstat (limited to 'server/tools/import-videos.ts')
-rw-r--r--server/tools/import-videos.ts17
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
48async function promptPassword () { 48async 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
68async function run () { 69async 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'])