]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - scripts/reset-password.ts
Add FreeBSD documentation
[github/Chocobozzz/PeerTube.git] / scripts / reset-password.ts
index 5ab7d01e5d38ba54bd456f44f3850f255412486f..6516edc287b776f5f3295f693fd9f559ea059e23 100755 (executable)
@@ -1,6 +1,6 @@
 import * as program from 'commander'
-
-import { database as db } from '../server/initializers/database'
+import { initDatabaseModels } from '../server/initializers'
+import { UserModel } from '../server/models/account/user'
 
 program
   .option('-u, --user [user]', 'User')
@@ -11,14 +11,14 @@ if (program['user'] === undefined) {
   process.exit(-1)
 }
 
-db.init(true)
+initDatabaseModels(true)
   .then(() => {
-    return db.User.loadByUsername(program['user'])
+    return UserModel.loadByUsername(program['user'])
   })
   .then(user => {
     if (!user) {
       console.error('User unknown.')
-      return
+      process.exit(-1)
     }
 
     const readline = require('readline')