Skip to content

Commit

Permalink
build_helper: rename (try_)run_silent -> (try_)run
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Aug 1, 2019
1 parent 79a1e7a commit 0d8c97b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ use std::os::unix::fs::symlink as symlink_file;
use std::os::windows::fs::symlink_file;

use build_helper::{
mtime, output, run_silent, run_suppressed, t, try_run_silent, try_run_suppressed,
mtime, output, run, run_suppressed, t, try_run, try_run_suppressed,
};
use filetime::FileTime;

Expand Down Expand Up @@ -682,7 +682,7 @@ impl Build {
fn run(&self, cmd: &mut Command) {
if self.config.dry_run { return; }
self.verbose(&format!("running: {:?}", cmd));
run_silent(cmd)
run(cmd)
}

/// Runs a command, printing out nice contextual information if it fails.
Expand All @@ -698,7 +698,7 @@ impl Build {
fn try_run(&self, cmd: &mut Command) -> bool {
if self.config.dry_run { return true; }
self.verbose(&format!("running: {:?}", cmd));
try_run_silent(cmd)
try_run(cmd)
}

/// Runs a command, printing out nice contextual information if it fails.
Expand Down
8 changes: 4 additions & 4 deletions src/build_helper/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ pub fn restore_library_path() {
/// Run the command, printing what we are running.
pub fn run_verbose(cmd: &mut Command) {
println!("running: {:?}", cmd);
run_silent(cmd);
run(cmd);
}

pub fn run_silent(cmd: &mut Command) {
if !try_run_silent(cmd) {
pub fn run(cmd: &mut Command) {
if !try_run(cmd) {
std::process::exit(1);
}
}

pub fn try_run_silent(cmd: &mut Command) -> bool {
pub fn try_run(cmd: &mut Command) -> bool {
let status = match cmd.status() {
Ok(status) => status,
Err(e) => fail(&format!(
Expand Down

0 comments on commit 0d8c97b

Please sign in to comment.