Dedupe must_run_cmd. I think I did this before updater took a dependency on abstutil.

This commit is contained in:
Dustin Carlino 2021-01-19 14:41:56 -08:00
parent 30dc328f06
commit 9ddf658e96

View File

@ -7,7 +7,7 @@ use anyhow::{Context, Result};
use walkdir::WalkDir;
use abstio::{DataPacks, Entry, Manifest};
use abstutil::{prettyprint_usize, CmdArgs, Parallelism, Timer};
use abstutil::{must_run_cmd, prettyprint_usize, CmdArgs, Parallelism, Timer};
use geom::Percent;
const MD5_BUF_READ_SIZE: usize = 4096;
@ -227,20 +227,6 @@ fn md5sum(path: &str) -> (String, usize) {
(format!("{:x}", context.compute()), uncompressed_size_bytes)
}
fn must_run_cmd(cmd: &mut Command) {
println!("> Running {:?}", cmd);
match cmd.status() {
Ok(status) => {
if !status.success() {
panic!("{:?} failed", cmd);
}
}
Err(err) => {
panic!("Failed to run {:?}: {:?}", cmd, err);
}
}
}
fn rm(path: &str) {
println!("> rm {}", path);
match std::fs::remove_file(path) {