File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,23 +36,21 @@ const showHelp = () => {
3636 }
3737
3838 const [ command ] = options . _ ;
39- if ( command === 'help' ) {
39+ if ( command === 'help' || ! command ) {
4040 showHelp ( ) ;
4141 process . exit ( 0 ) ;
4242 }
4343
44- if ( command ) {
45- if ( options . help ) {
46- console . info ( HELP_COMMANDS [ command ] ) ;
47- process . exit ( 0 ) ;
48- }
49- scripts [ command ] ( options ) . then ( ( ) => {
50- console . info ( `"${ command } " command run successfully.` ) ;
51- process . exit ( 0 ) ;
52- } ) . catch ( ( error ) => {
53- console . error ( error , `An error has occured while running command (${ command } ).` ) ;
54- process . exit ( 1 ) ;
55- } ) ;
44+ if ( options . help ) {
45+ console . info ( HELP_COMMANDS [ command ] ) ;
46+ process . exit ( 0 ) ;
5647 }
48+ scripts [ command ] ( options ) . then ( ( ) => {
49+ console . info ( `"${ command } " command run successfully.` ) ;
50+ process . exit ( 0 ) ;
51+ } ) . catch ( ( error ) => {
52+ console . error ( error , `An error has occured while running command (${ command } ).` ) ;
53+ process . exit ( 1 ) ;
54+ } ) ;
5755
5856} ) ( ) ;
You can’t perform that action at this time.
0 commit comments