File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -5,13 +5,14 @@ const cmdArgs = require('command-line-args');
55require ( './utils/process-log' ) ;
66
77const isFlagPresent = ( args , flag ) => args . find ( arg => [ flag , `--${ flag } ` ] . includes ( arg ) ) ;
8+ const isArgCommandName = ( arg , cmd ) => arg === cmd . name || arg === cmd . alias ;
89const stripDashedFlags = ( args , cmd ) => {
910 const slicedArgs = args . slice ( 2 ) ;
1011 if ( cmd . name === 'serve' ) {
11- return slicedArgs . filter ( arg => arg !== cmd . name && arg !== cmd . alias ) ;
12+ return slicedArgs . filter ( arg => ! isArgCommandName ( arg , cmd ) ) ;
1213 }
1314 else {
14- return slicedArgs . filter ( arg => ~ arg . indexOf ( '--' ) && arg !== cmd . name && arg !== cmd . alias ) ;
15+ return slicedArgs . filter ( arg => ~ arg . indexOf ( '--' ) && ! isArgCommandName ( arg , cmd ) ) ;
1516 }
1617} ;
1718
You can’t perform that action at this time.
0 commit comments