Hide output of msgfmt -h

This command is only used to determine availability of `msgfmt`. Without
these changes, the entire help output shows up if the code panics later
on, which adds useless bloat to the output, making it harder to analyze
what went wrong.

Closes #11848
This commit is contained in:
Daniel Rainer
2025-10-01 01:19:33 +02:00
committed by Johannes Altmanninger
parent c145ee6df3
commit 918e7abe6b

View File

@@ -2,7 +2,7 @@
env, env,
ffi::OsStr, ffi::OsStr,
path::{Path, PathBuf}, path::{Path, PathBuf},
process::Command, process::{Command, Stdio},
}; };
fn main() { fn main() {
@@ -34,7 +34,11 @@ fn embed_localizations(cache_dir: &Path) {
// for the respective language. // for the respective language.
let mut catalogs = phf_codegen::Map::new(); let mut catalogs = phf_codegen::Map::new();
match Command::new("msgfmt").arg("-h").status() { match Command::new("msgfmt")
.arg("-h")
.stdout(Stdio::null())
.status()
{
Err(e) if e.kind() == std::io::ErrorKind::NotFound => { Err(e) if e.kind() == std::io::ErrorKind::NotFound => {
rsconf::warn!( rsconf::warn!(
"Cannot find msgfmt to build gettext message catalogs. Localization will not work." "Cannot find msgfmt to build gettext message catalogs. Localization will not work."