X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Freset-password.ts;h=7e7de6b8ae9e355dcf79b40fc7d18d7b8bf5525b;hb=02d6226abc53840b046060d28e8a13c568613db1;hp=bf6535cea85e1329e318b2a0ec67622bc0a82d35;hpb=f0af38e69677d1afe17e48b3f5267128db3db1a4;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/reset-password.ts b/scripts/reset-password.ts index bf6535cea..7e7de6b8a 100755 --- a/scripts/reset-password.ts +++ b/scripts/reset-password.ts @@ -10,25 +10,27 @@ 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) { - console.error('User unknown.') + console.error('Unknown user.') process.exit(-1) } const readline = require('readline') const Writable = require('stream').Writable const mutableStdout = new Writable({ - write: function (chunk, encoding, callback) { + write: function (_chunk, _encoding, callback) { callback() } })