@@ -19,6 +19,7 @@ import { printStats } from '../ui/compare/printStats.js';
1919import { printDuplicates } from '../ui/compare/printDuplicates.js' ;
2020import { printHeader } from '../ui/compare/printHeader.js' ;
2121import { printAutoFix } from '../ui/compare/printAutoFix.js' ;
22+ import { printIssues } from '../ui/compare/printIssues.js' ;
2223
2324/**
2425 * Compares multiple pairs of .env and .env.example files.
@@ -216,41 +217,7 @@ export async function compareMany(
216217 exitWithError = true ;
217218 }
218219
219- if ( ! opts . json ) {
220- if ( filtered . missing . length && ! opts . fix ) {
221- console . log ( chalk . red ( '❌ Missing keys:' ) ) ;
222- filtered . missing . forEach ( ( key ) => console . log ( chalk . red ( ` - ${ key } ` ) ) ) ;
223- console . log ( ) ;
224- }
225- if ( filtered . extra . length ) {
226- console . log ( chalk . yellow ( '⚠️ Extra keys (not in example):' ) ) ;
227- filtered . extra . forEach ( ( key ) =>
228- console . log ( chalk . yellow ( ` - ${ key } ` ) ) ,
229- ) ;
230- console . log ( ) ;
231- }
232- if ( filtered . empty . length ) {
233- console . log ( chalk . yellow ( '⚠️ Empty values:' ) ) ;
234- filtered . empty . forEach ( ( key ) =>
235- console . log ( chalk . yellow ( ` - ${ key } ` ) ) ,
236- ) ;
237- console . log ( ) ;
238- }
239- if ( filtered . mismatches . length ) {
240- console . log ( chalk . yellow ( '⚠️ Value mismatches:' ) ) ;
241- filtered . mismatches . forEach ( ( { key, expected, actual } ) =>
242- console . log (
243- chalk . yellow (
244- ` - ${ key } : expected '${ expected } ', but got '${ actual } '` ,
245- ) ,
246- ) ,
247- ) ;
248- console . log ( ) ;
249- }
250- if ( gitignoreMsg && ! opts . json ) {
251- console . log ( ( gitignoreMsg as string ) . replace ( / ^ / gm, ' ' ) ) ;
252- }
253- }
220+ printIssues ( filtered , opts . json ) ;
254221
255222 if ( ! opts . json && ! opts . fix ) {
256223 const ignored = isEnvIgnoredByGit ( { cwd : opts . cwd , envFile : '.env' } ) ;
0 commit comments