aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/peertube-auth.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-02-03 09:33:05 +0100
committerChocobozzz <me@florianbigard.com>2021-02-03 09:45:08 +0100
commitba5a8d89bbf049e4afc41543bcc072cccdb02669 (patch)
tree6cc6b2dca17745cc0824c7ad4515f3bc4883fa4a /server/tools/peertube-auth.ts
parent29f148a61381727a432c22a71c7a2b7cc23d9c9e (diff)
downloadPeerTube-ba5a8d89bbf049e4afc41543bcc072cccdb02669.tar.gz
PeerTube-ba5a8d89bbf049e4afc41543bcc072cccdb02669.tar.zst
PeerTube-ba5a8d89bbf049e4afc41543bcc072cccdb02669.zip
Update server dependencies
Diffstat (limited to 'server/tools/peertube-auth.ts')
-rw-r--r--server/tools/peertube-auth.ts20
1 files changed, 9 insertions, 11 deletions
diff --git a/server/tools/peertube-auth.ts b/server/tools/peertube-auth.ts
index 6a0b89fe2..e54649002 100644
--- a/server/tools/peertube-auth.ts
+++ b/server/tools/peertube-auth.ts
@@ -66,7 +66,8 @@ program
66 .option('-U, --username <username>', 'Username') 66 .option('-U, --username <username>', 'Username')
67 .option('-p, --password <token>', 'Password') 67 .option('-p, --password <token>', 'Password')
68 .option('--default', 'add the entry as the new default') 68 .option('--default', 'add the entry as the new default')
69 .action(options => { 69 .action((options: program.OptionValues) => {
70 /* eslint-disable no-import-assign */
70 prompt.override = options 71 prompt.override = options
71 prompt.start() 72 prompt.start()
72 prompt.get({ 73 prompt.get({
@@ -102,7 +103,7 @@ program
102 process.exit(-1) 103 process.exit(-1)
103 } 104 }
104 105
105 await setInstance(result.url, result.username, result.password, program['default']) 106 await setInstance(result.url, result.username, result.password, options.default)
106 107
107 process.exit(0) 108 process.exit(0)
108 }) 109 })
@@ -160,15 +161,12 @@ program
160 } 161 }
161 }) 162 })
162 163
163program.on('--help', function () { 164program.addHelpText('after', '\n\n Examples:\n\n' +
164 console.log(' Examples:') 165 ' $ peertube auth add -u https://peertube.cpy.re -U "PEERTUBE_USER" --password "PEERTUBE_PASSWORD"\n' +
165 console.log() 166 ' $ peertube auth add -u https://peertube.cpy.re -U root\n' +
166 console.log(' $ peertube auth add -u https://peertube.cpy.re -U "PEERTUBE_USER" --password "PEERTUBE_PASSWORD"') 167 ' $ peertube auth list\n' +
167 console.log(' $ peertube auth add -u https://peertube.cpy.re -U root') 168 ' $ peertube auth del https://peertube.cpy.re\n'
168 console.log(' $ peertube auth list') 169)
169 console.log(' $ peertube auth del https://peertube.cpy.re')
170 console.log()
171})
172 170
173if (!process.argv.slice(2).length) { 171if (!process.argv.slice(2).length) {
174 program.outputHelp() 172 program.outputHelp()