X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Freset-password.ts;h=6372095d6da633568abb363de8155b39b4eb79c2;hb=053aed43fb255b4ae4324a845534f2f562c3b6cc;hp=4a9037280804c52095e402c967721271962c7eec;hpb=98d33a03d3a86aad709e2cd39a4e4d8bac6b7664;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/reset-password.ts b/scripts/reset-password.ts index 4a9037280..6372095d6 100755 --- a/scripts/reset-password.ts +++ b/scripts/reset-password.ts @@ -1,5 +1,8 @@ +import { registerTSPaths } from '../server/helpers/register-ts-paths' +registerTSPaths() + import * as program from 'commander' -import { initDatabaseModels } from '../server/initializers' +import { initDatabaseModels } from '../server/initializers/database' import { UserModel } from '../server/models/account/user' import { isUserPasswordValid } from '../server/helpers/custom-validators/users' @@ -18,7 +21,7 @@ initDatabaseModels(true) }) .then(user => { if (!user) { - console.error('User unknown.') + console.error('Unknown user.') process.exit(-1) } @@ -50,3 +53,7 @@ initDatabaseModels(true) .finally(() => process.exit(0)) }) }) + .catch(err => { + console.error(err) + process.exit(-1) + })