Skip to content

Commit f43f106

Browse files
committed
vercel-review
1 parent b46c31a commit f43f106

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/commands/rg/rg-search.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

src/spec-tests/cases/builtin-bracket.test.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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
299298
tmp=$TMP/builtin-test-1
300299
mkdir -p $tmp
301300
touch $tmp/zz

0 commit comments

Comments
 (0)