Fix the paths in grunt tasks (#643)

This commit is contained in:
Matthieu Simonin 2019-10-08 12:46:53 +02:00 committed by Miguel Serrano
parent d38e5a857e
commit de33a6a7b6

View file

@ -5,12 +5,12 @@ module.exports = (grunt) ->
done = @async()
email = grunt.option("email")
if !email?
console.error "Usage: grunt user:create-admin --email joe@example.com"
console.error "Usage: grunt user:create-admin --email=joe@example.com"
process.exit(1)
settings = require "settings-sharelatex"
UserRegistrationHandler = require "../web/app/js/Features/User/UserRegistrationHandler"
OneTimeTokenHandler = require "../web/app/js/Features/Security/OneTimeTokenHandler"
UserRegistrationHandler = require "../web/app/src/Features/User/UserRegistrationHandler"
OneTimeTokenHandler = require "../web/app/src/Features/Security/OneTimeTokenHandler"
UserRegistrationHandler.registerNewUser {
email: email
password: require("crypto").randomBytes(32).toString("hex")
@ -39,11 +39,11 @@ module.exports = (grunt) ->
done = @async()
email = grunt.option("email")
if !email?
console.error "Usage: grunt user:delete --email joe@example.com"
console.error "Usage: grunt user:delete --email=joe@example.com"
process.exit(1)
settings = require "settings-sharelatex"
UserGetter = require "../web/app/js/Features/User/UserGetter"
UserDeleter = require "../web/app/js/Features/User/UserDeleter"
UserGetter = require "../web/app/src/Features/User/UserGetter"
UserDeleter = require "../web/app/src/Features/User/UserDeleter"
UserGetter.getUser email:email, (error, user) ->
if error?
throw error
@ -53,4 +53,4 @@ module.exports = (grunt) ->
UserDeleter.deleteUser user._id, (err)->
if err?
throw err
done()
done()