Skip to content

Commit

Permalink
cmd: redirect stderr to /dev/null in capture_stdout()
Browse files Browse the repository at this point in the history
Ensure that exec expressions and internal git queries run by garden
do not report stderr to the terminal.
  • Loading branch information
davvid committed Dec 11, 2023
1 parent c9c84fd commit d1f525f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ pub fn capture_stdout(
) -> Result<subprocess::CaptureData, errors::CommandError> {
let command = exec.to_cmdline_lossy();
exec.stdout(subprocess::Redirection::Pipe)
.stderr(subprocess::NullFile {}) // Redirect stderr to /dev/null
.capture()
.map_err(|popen_err| command_error_from_popen_error(command, popen_err))
}
Expand Down

0 comments on commit d1f525f

Please sign in to comment.