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) {
3737async function createUser ( argv ) {
3838 const existingUser = await models . User . findOne ( { where : { email : argv [ 'add' ] } } )
3939 // Cannot create already-existing users
40- if ( existingUser !== undefined ) {
40+ if ( existingUser ) {
4141 console . log ( `User with e-mail ${ existingUser . email } already exists! Aborting ...` )
42- process . exit ( 1 )
42+ process . exit ( 2 )
4343 }
4444
4545 const pass = getPass ( argv , 'add' )
@@ -56,7 +56,7 @@ async function createUser (argv) {
5656async function deleteUser ( argv ) {
5757 // Cannot delete non-existing users
5858 const existingUser = await models . User . findOne ( { where : { email : argv [ 'del' ] } } )
59- if ( existingUser === undefined ) {
59+ if ( ! existingUser ) {
6060 console . log ( `User with e-mail ${ argv [ 'del' ] } does not exist, cannot delete` )
6161 process . exit ( 1 )
6262 }
@@ -71,7 +71,7 @@ async function deleteUser (argv) {
7171async function resetUser ( argv ) {
7272 const existingUser = await models . User . findOne ( { where : { email : argv [ 'reset' ] } } )
7373 // Cannot reset non-existing users
74- if ( existingUser === undefined ) {
74+ if ( ! existingUser ) {
7575 console . log ( `User with e-mail ${ argv [ 'reset' ] } does not exist, cannot reset` )
7676 process . exit ( 1 )
7777 }
You can’t perform that action at this time.
0 commit comments