diff options
author | Chocobozzz <me@florianbigard.com> | 2021-02-03 09:33:05 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-02-03 09:45:08 +0100 |
commit | ba5a8d89bbf049e4afc41543bcc072cccdb02669 (patch) | |
tree | 6cc6b2dca17745cc0824c7ad4515f3bc4883fa4a /scripts/reset-password.ts | |
parent | 29f148a61381727a432c22a71c7a2b7cc23d9c9e (diff) | |
download | PeerTube-ba5a8d89bbf049e4afc41543bcc072cccdb02669.tar.gz PeerTube-ba5a8d89bbf049e4afc41543bcc072cccdb02669.tar.zst PeerTube-ba5a8d89bbf049e4afc41543bcc072cccdb02669.zip |
Update server dependencies
Diffstat (limited to 'scripts/reset-password.ts')
-rwxr-xr-x | scripts/reset-password.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/reset-password.ts b/scripts/reset-password.ts index 6372095d6..7e7de6b8a 100755 --- a/scripts/reset-password.ts +++ b/scripts/reset-password.ts | |||
@@ -10,14 +10,16 @@ program | |||
10 | .option('-u, --user [user]', 'User') | 10 | .option('-u, --user [user]', 'User') |
11 | .parse(process.argv) | 11 | .parse(process.argv) |
12 | 12 | ||
13 | if (program['user'] === undefined) { | 13 | const options = program.opts() |
14 | |||
15 | if (options.user === undefined) { | ||
14 | console.error('All parameters are mandatory.') | 16 | console.error('All parameters are mandatory.') |
15 | process.exit(-1) | 17 | process.exit(-1) |
16 | } | 18 | } |
17 | 19 | ||
18 | initDatabaseModels(true) | 20 | initDatabaseModels(true) |
19 | .then(() => { | 21 | .then(() => { |
20 | return UserModel.loadByUsername(program['user']) | 22 | return UserModel.loadByUsername(options.user) |
21 | }) | 23 | }) |
22 | .then(user => { | 24 | .then(user => { |
23 | if (!user) { | 25 | if (!user) { |
@@ -28,7 +30,7 @@ initDatabaseModels(true) | |||
28 | const readline = require('readline') | 30 | const readline = require('readline') |
29 | const Writable = require('stream').Writable | 31 | const Writable = require('stream').Writable |
30 | const mutableStdout = new Writable({ | 32 | const mutableStdout = new Writable({ |
31 | write: function (chunk, encoding, callback) { | 33 | write: function (_chunk, _encoding, callback) { |
32 | callback() | 34 | callback() |
33 | } | 35 | } |
34 | }) | 36 | }) |