@@ -70,6 +70,7 @@ cli.on('requireFail', function(name, error) {
7070 ansi . yellow ( 'Failed to load external module' ) ,
7171 ansi . magenta ( name )
7272 ) ;
73+ /* istanbul ignore else */
7374 if ( error ) {
7475 log . warn ( ansi . yellow ( error . toString ( ) ) ) ;
7576 }
@@ -122,20 +123,20 @@ function handleArguments(env) {
122123
123124 // Anything that needs to print outside of the logging mechanism should use console.log
124125 if ( opts . version ) {
125- console . log ( 'CLI version' , cliVersion ) ;
126- if ( env . modulePackage && typeof env . modulePackage . version !== 'undefined' ) {
127- console . log ( 'Local version' , env . modulePackage . version ) ;
128- }
126+ console . log ( 'CLI version:' , cliVersion ) ;
127+ console . log ( 'Local version:' , env . modulePackage . version || 'Unknown' ) ;
129128 exit ( 0 ) ;
130129 }
131130
132131 if ( opts . verify ) {
133132 var pkgPath = opts . verify !== true ? opts . verify : 'package.json' ;
133+ /* istanbul ignore else */
134134 if ( path . resolve ( pkgPath ) !== path . normalize ( pkgPath ) ) {
135135 pkgPath = path . join ( env . cwd , pkgPath ) ;
136136 }
137137 log . info ( 'Verifying plugins in ' + pkgPath ) ;
138138 return getBlacklist ( function ( err , blacklist ) {
139+ /* istanbul ignore if */
139140 if ( err ) {
140141 return logBlacklistError ( err ) ;
141142 }
@@ -147,10 +148,12 @@ function handleArguments(env) {
147148 }
148149
149150 if ( ! env . modulePath ) {
151+ /* istanbul ignore next */
150152 var missingNodeModules =
151153 fs . existsSync ( path . join ( env . cwd , 'package.json' ) )
152154 && ! fs . existsSync ( path . join ( env . cwd , 'node_modules' ) ) ;
153155
156+ /* istanbul ignore next */
154157 var missingGulpMessage =
155158 missingNodeModules
156159 ? 'Local modules not found in'
@@ -159,6 +162,7 @@ function handleArguments(env) {
159162 ansi . red ( missingGulpMessage ) ,
160163 ansi . magenta ( tildify ( env . cwd ) )
161164 ) ;
165+ /* istanbul ignore next */
162166 var installCommand =
163167 missingNodeModules
164168 ? 'npm install'
@@ -186,9 +190,10 @@ function handleArguments(env) {
186190 var range = findRange ( env . modulePackage . version , ranges ) ;
187191
188192 if ( ! range ) {
189- return log . error (
193+ log . error (
190194 ansi . red ( 'Unsupported gulp version' , env . modulePackage . version )
191195 ) ;
196+ exit ( 1 ) ;
192197 }
193198
194199 // Load and execute the CLI version
0 commit comments