@@ -162,39 +162,41 @@ function formatFilesFromGlobs({
162162 }
163163
164164 function onComplete ( ) {
165- const isNotSilent = logger . getLevel ( ) !== logger . levels . SILENT ;
165+ const isSilent = logger . getLevel ( ) === logger . levels . SILENT || cliOptions . listDifferent ;
166166
167167 /* use console.error directly here because
168168 * - we don't want these messages prefixed
169169 * - we want them to go to stderr, not stdout
170170 */
171- if ( successes . length && isNotSilent ) {
172- console . error (
173- messages . success ( {
174- success : chalk . green ( 'success' ) ,
175- count : successes . length ,
176- countString : chalk . bold ( successes . length )
177- } )
178- ) ;
179- }
180- if ( failures . length && isNotSilent ) {
181- process . exitCode = 1 ;
182- console . error (
183- messages . failure ( {
184- failure : chalk . red ( 'failure' ) ,
185- count : failures . length ,
186- countString : chalk . bold ( failures . length )
187- } )
188- ) ;
189- }
190- if ( unchanged . length && isNotSilent ) {
191- console . error (
192- messages . unchanged ( {
193- unchanged : chalk . gray ( 'unchanged' ) ,
194- count : unchanged . length ,
195- countString : chalk . bold ( unchanged . length )
196- } )
197- ) ;
171+ if ( ! isSilent ) {
172+ if ( successes . length ) {
173+ console . error (
174+ messages . success ( {
175+ success : chalk . green ( 'success' ) ,
176+ count : successes . length ,
177+ countString : chalk . bold ( successes . length )
178+ } )
179+ ) ;
180+ }
181+ if ( failures . length ) {
182+ process . exitCode = 1 ;
183+ console . error (
184+ messages . failure ( {
185+ failure : chalk . red ( 'failure' ) ,
186+ count : failures . length ,
187+ countString : chalk . bold ( failures . length )
188+ } )
189+ ) ;
190+ }
191+ if ( unchanged . length ) {
192+ console . error (
193+ messages . unchanged ( {
194+ unchanged : chalk . gray ( 'unchanged' ) ,
195+ count : unchanged . length ,
196+ countString : chalk . bold ( unchanged . length )
197+ } )
198+ ) ;
199+ }
198200 }
199201 resolve ( { successes, failures } ) ;
200202 }
0 commit comments