Skip to content

Commit 2353b3a

Browse files
committed
Drop unnecessary (always true) verbose argument from task::run()
1 parent cd6f8f6 commit 2353b3a

File tree

4 files changed

+8
-25
lines changed

4 files changed

+8
-25
lines changed

xbuild/src/cargo/mod.rs

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

xbuild/src/download.rs

+1-4
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

-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ pub fn build(env: &BuildEnv, out: &Path) -> Result<()> {
165165
Format::Apk => "assemble",
166166
_ => unreachable!(),
167167
}),
168-
true,
169168
)?;
170169
let output = gradle
171170
.join("app")

xbuild/src/task.rs

+6-19
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)