Skip to content

Commit 2c967e1

Browse files
committed
Drop unnecessary (always true) verbose argument from task::run()
1 parent 6ccd0ea commit 2c967e1

File tree

4 files changed

+8
-25
lines changed

4 files changed

+8
-25
lines changed

xbuild/src/cargo/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ impl CargoBuild {
468468
self.cc_triple_env("CFLAGS", &self.c_flags.clone());
469469
// These strings already end with a space if they're non-empty:
470470
self.cc_triple_env("CXXFLAGS", &format!("{}{}", self.c_flags, self.cxx_flags));
471-
task::run(&mut self.cmd, true)?;
471+
task::run(&mut self.cmd)?;
472472
Ok(())
473473
}
474474
}

xbuild/src/download.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,7 @@ impl<'a> DownloadManager<'a> {
115115
}
116116

117117
fn rustup_target(&self, target: &str) -> Result<()> {
118-
task::run(
119-
Command::new("rustup").arg("target").arg("add").arg(target),
120-
true,
121-
)
118+
task::run(Command::new("rustup").arg("target").arg("add").arg(target))
122119
}
123120

124121
pub fn prefetch(&self) -> Result<()> {

xbuild/src/gradle/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ pub fn build(env: &BuildEnv, libraries: Vec<(Target, PathBuf)>, out: &Path) -> R
208208
Format::Apk => "assemble",
209209
_ => unreachable!(),
210210
}),
211-
true,
212211
)?;
213212
let output = gradle
214213
.join("app")

xbuild/src/task.rs

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl TaskRunner {
6666
}
6767
}
6868

69-
pub fn run(command: &mut Command, verbose: bool) -> Result<()> {
69+
pub fn run(command: &mut Command) -> Result<()> {
7070
fn format_error(command: &Command, status: Option<i32>) -> String {
7171
let status = if let Some(code) = status {
7272
format!(" exited with {code}")
@@ -75,24 +75,11 @@ pub fn run(command: &mut Command, verbose: bool) -> Result<()> {
7575
};
7676
format!("{} `{:?}`{}", style("[ERROR]").red(), command, status)
7777
}
78-
if !verbose {
79-
let output = command
80-
.output()
81-
.with_context(|| format_error(command, None))?;
82-
if !output.status.success() {
83-
let stdout = std::str::from_utf8(&output.stdout)?;
84-
print!("{stdout}");
85-
let stderr = std::str::from_utf8(&output.stderr)?;
86-
print!("{stderr}");
87-
anyhow::bail!("{}", format_error(command, output.status.code()));
88-
}
89-
} else {
90-
let status = command
91-
.status()
92-
.with_context(|| format_error(command, None))?;
93-
if !status.success() {
94-
anyhow::bail!("{}", format_error(command, status.code()));
95-
}
78+
let status = command
79+
.status()
80+
.with_context(|| format_error(command, None))?;
81+
if !status.success() {
82+
anyhow::bail!("{}", format_error(command, status.code()));
9683
}
9784
Ok(())
9885
}

0 commit comments

Comments
 (0)