Skip to content

Commit bb505b0

Browse files
committed
return exit status of rg (fixes #139)
1 parent 2fcf565 commit bb505b0

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
# 0.10.5 (2024-01-16)
2+
3+
- return the same exit status as rg
4+
15
# 0.10.4 (2024-01-16)
26

37
- add `--rga-no-prefix-filenames` flag (https://github.com/phiresky/ripgrep-all/issues/154)
48

5-
# 0.10.3 (2024-01-16)
9+
# 0.10.3 (2024-01-15)
610

711
This was originally supposed to be version 1.0.0, but I don't feel confident enough in the stability to call it that.
812

src/bin/rga.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,12 @@ fn main() -> anyhow::Result<()> {
133133
.spawn()
134134
.map_err(|e| map_exe_error(e, "rg", "Please make sure you have ripgrep installed."))?;
135135

136-
child.wait()?;
136+
let result = child.wait()?;
137137

138138
log::debug!("running rg took {}", print_dur(before));
139+
if !result.success() {
140+
std::process::exit(result.code().unwrap_or(1));
141+
}
139142
Ok(())
140143
}
141144

0 commit comments

Comments
 (0)