@@ -70,6 +70,7 @@ cli.on('requireFail', function(name, error) {
70
70
ansi . yellow ( 'Failed to load external module' ) ,
71
71
ansi . magenta ( name )
72
72
) ;
73
+ /* istanbul ignore else */
73
74
if ( error ) {
74
75
log . warn ( ansi . yellow ( error . toString ( ) ) ) ;
75
76
}
@@ -122,20 +123,20 @@ function handleArguments(env) {
122
123
123
124
// Anything that needs to print outside of the logging mechanism should use console.log
124
125
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' ) ;
129
128
exit ( 0 ) ;
130
129
}
131
130
132
131
if ( opts . verify ) {
133
132
var pkgPath = opts . verify !== true ? opts . verify : 'package.json' ;
133
+ /* istanbul ignore else */
134
134
if ( path . resolve ( pkgPath ) !== path . normalize ( pkgPath ) ) {
135
135
pkgPath = path . join ( env . cwd , pkgPath ) ;
136
136
}
137
137
log . info ( 'Verifying plugins in ' + pkgPath ) ;
138
138
return getBlacklist ( function ( err , blacklist ) {
139
+ /* istanbul ignore if */
139
140
if ( err ) {
140
141
return logBlacklistError ( err ) ;
141
142
}
@@ -147,10 +148,12 @@ function handleArguments(env) {
147
148
}
148
149
149
150
if ( ! env . modulePath ) {
151
+ /* istanbul ignore next */
150
152
var missingNodeModules =
151
153
fs . existsSync ( path . join ( env . cwd , 'package.json' ) )
152
154
&& ! fs . existsSync ( path . join ( env . cwd , 'node_modules' ) ) ;
153
155
156
+ /* istanbul ignore next */
154
157
var missingGulpMessage =
155
158
missingNodeModules
156
159
? 'Local modules not found in'
@@ -159,6 +162,7 @@ function handleArguments(env) {
159
162
ansi . red ( missingGulpMessage ) ,
160
163
ansi . magenta ( tildify ( env . cwd ) )
161
164
) ;
165
+ /* istanbul ignore next */
162
166
var installCommand =
163
167
missingNodeModules
164
168
? 'npm install'
@@ -186,9 +190,10 @@ function handleArguments(env) {
186
190
var range = findRange ( env . modulePackage . version , ranges ) ;
187
191
188
192
if ( ! range ) {
189
- return log . error (
193
+ log . error (
190
194
ansi . red ( 'Unsupported gulp version' , env . modulePackage . version )
191
195
) ;
196
+ exit ( 1 ) ;
192
197
}
193
198
194
199
// Load and execute the CLI version
0 commit comments