File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import fs from 'fs' ;
22import path from 'path' ;
3- import chalk from 'chalk' ;
43import { parseEnvFile } from '../core/parseEnv.js' ;
54import { diffEnv } from '../core/diffEnv.js' ;
65import { warnIfEnvNotIgnored , isEnvIgnoredByGit } from '../services/git.js' ;
@@ -20,6 +19,7 @@ import { printDuplicates } from '../ui/compare/printDuplicates.js';
2019import { printHeader } from '../ui/compare/printHeader.js' ;
2120import { printAutoFix } from '../ui/compare/printAutoFix.js' ;
2221import { printIssues } from '../ui/compare/printIssues.js' ;
22+ import { printSuccess } from '../ui/compare/printSuccess.js' ;
2323
2424/**
2525 * Compares multiple pairs of .env and .env.example files.
@@ -177,10 +177,7 @@ export async function compareMany(
177177
178178 if ( allOk ) {
179179 entry . ok = true ;
180- if ( ! opts . json ) {
181- console . log ( chalk . green ( '✅ All keys match.' ) ) ;
182- console . log ( ) ;
183- }
180+ printSuccess ( opts . json ) ;
184181 opts . collect ?.( entry ) ;
185182 continue ;
186183 }
Original file line number Diff line number Diff line change 1+ import chalk from 'chalk' ;
2+
3+ /**
4+ * Prints a success message when all keys match.
5+ * @param json Whether to output in JSON format.
6+ */
7+ export function printSuccess ( json : boolean | undefined ) {
8+ if ( json ) return ;
9+
10+ console . log ( chalk . green ( '✅ All keys match.' ) ) ;
11+ console . log ( ) ;
12+ }
You can’t perform that action at this time.
0 commit comments