diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-11 17:23:24 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-07-24 10:58:16 +0200 |
commit | 8d2be0ed7bb87283a1ec98609df6b82d83db706a (patch) | |
tree | 31a36b252df32be83ceb77658a53b57f9d15e8ac /server/tools/peertube-auth.ts | |
parent | dba85a1e9e9f603ba52e1ea42deaf3fdd799b1d8 (diff) | |
download | PeerTube-8d2be0ed7bb87283a1ec98609df6b82d83db706a.tar.gz PeerTube-8d2be0ed7bb87283a1ec98609df6b82d83db706a.tar.zst PeerTube-8d2be0ed7bb87283a1ec98609df6b82d83db706a.zip |
WIP plugins: move plugin CLI in peertube script
Install/uninstall/list plugins remotely
Diffstat (limited to 'server/tools/peertube-auth.ts')
-rw-r--r-- | server/tools/peertube-auth.ts | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/server/tools/peertube-auth.ts b/server/tools/peertube-auth.ts index 1035d664a..d4ad56e47 100644 --- a/server/tools/peertube-auth.ts +++ b/server/tools/peertube-auth.ts | |||
@@ -1,8 +1,8 @@ | |||
1 | import * as program from 'commander' | 1 | import * as program from 'commander' |
2 | import * as prompt from 'prompt' | 2 | import * as prompt from 'prompt' |
3 | import { getSettings, writeSettings, getNetrc } from './cli' | 3 | import { getNetrc, getSettings, writeSettings } from './cli' |
4 | import { isHostValid } from '../helpers/custom-validators/servers' | ||
5 | import { isUserUsernameValid } from '../helpers/custom-validators/users' | 4 | import { isUserUsernameValid } from '../helpers/custom-validators/users' |
5 | import { getAccessToken, login } from '../../shared/extra-utils' | ||
6 | 6 | ||
7 | const Table = require('cli-table') | 7 | const Table = require('cli-table') |
8 | 8 | ||
@@ -76,6 +76,14 @@ program | |||
76 | } | 76 | } |
77 | } | 77 | } |
78 | }, async (_, result) => { | 78 | }, async (_, result) => { |
79 | // Check credentials | ||
80 | try { | ||
81 | await getAccessToken(result.url, result.username, result.password) | ||
82 | } catch (err) { | ||
83 | console.error(err.message) | ||
84 | process.exit(-1) | ||
85 | } | ||
86 | |||
79 | await setInstance(result.url, result.username, result.password, program['default']) | 87 | await setInstance(result.url, result.username, result.password, program['default']) |
80 | 88 | ||
81 | process.exit(0) | 89 | process.exit(0) |