File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -691,9 +691,20 @@ async function searchFiles(
691691 // In non-JSON quiet mode, output nothing
692692 const finalStdout = options . quiet && ! options . json ? "" : stdout ;
693693
694+ // Exit codes:
695+ // - For --files-without-match: 0 if files without matches found, 1 otherwise
696+ // - For normal mode: 0 if any matches found, 1 otherwise
697+ let exitCode : number ;
698+ if ( options . filesWithoutMatch ) {
699+ // Success means we found files without matches (stdout has content)
700+ exitCode = stdout . length > 0 ? 0 : 1 ;
701+ } else {
702+ exitCode = anyMatch ? 0 : 1 ;
703+ }
704+
694705 return {
695706 stdout : finalStdout ,
696707 stderr : "" ,
697- exitCode : anyMatch ? 0 : 1 ,
708+ exitCode,
698709 } ;
699710}
Original file line number Diff line number Diff line change @@ -295,7 +295,6 @@ status=1
295295# # END
296296
297297# ### -h and -L test for symlink
298- # # SKIP: Symbolic links (ln -s) not implemented
299298tmp= $TMP /builtin-test-1
300299mkdir -p $tmp
301300touch $tmp /zz
You can’t perform that action at this time.
0 commit comments