File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -37,9 +37,9 @@ function getPass (argv, action) {
37
37
async function createUser ( argv ) {
38
38
const existingUser = await models . User . findOne ( { where : { email : argv [ 'add' ] } } )
39
39
// Cannot create already-existing users
40
- if ( existingUser !== undefined ) {
40
+ if ( existingUser ) {
41
41
console . log ( `User with e-mail ${ existingUser . email } already exists! Aborting ...` )
42
- process . exit ( 1 )
42
+ process . exit ( 2 )
43
43
}
44
44
45
45
const pass = getPass ( argv , 'add' )
@@ -56,7 +56,7 @@ async function createUser (argv) {
56
56
async function deleteUser ( argv ) {
57
57
// Cannot delete non-existing users
58
58
const existingUser = await models . User . findOne ( { where : { email : argv [ 'del' ] } } )
59
- if ( existingUser === undefined ) {
59
+ if ( ! existingUser ) {
60
60
console . log ( `User with e-mail ${ argv [ 'del' ] } does not exist, cannot delete` )
61
61
process . exit ( 1 )
62
62
}
@@ -71,7 +71,7 @@ async function deleteUser (argv) {
71
71
async function resetUser ( argv ) {
72
72
const existingUser = await models . User . findOne ( { where : { email : argv [ 'reset' ] } } )
73
73
// Cannot reset non-existing users
74
- if ( existingUser === undefined ) {
74
+ if ( ! existingUser ) {
75
75
console . log ( `User with e-mail ${ argv [ 'reset' ] } does not exist, cannot reset` )
76
76
process . exit ( 1 )
77
77
}
You can’t perform that action at this time.
0 commit comments