X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Freset-password.ts;h=7e7de6b8ae9e355dcf79b40fc7d18d7b8bf5525b;hb=71926aae0762facb25243f27eaf45933b5a37353;hp=6372095d6da633568abb363de8155b39b4eb79c2;hpb=f4659d73fb2d81c9a8f8d1f592ca873b622a194b;p=github%2FChocobozzz%2FPeerTube.git 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 .option('-u, --user [user]', 'User') .parse(process.argv) -if (program['user'] === undefined) { +const options = program.opts() + +if (options.user === undefined) { console.error('All parameters are mandatory.') process.exit(-1) } initDatabaseModels(true) .then(() => { - return UserModel.loadByUsername(program['user']) + return UserModel.loadByUsername(options.user) }) .then(user => { if (!user) { @@ -28,7 +30,7 @@ initDatabaseModels(true) const readline = require('readline') const Writable = require('stream').Writable const mutableStdout = new Writable({ - write: function (chunk, encoding, callback) { + write: function (_chunk, _encoding, callback) { callback() } })