Dedupe must_run_cmd. I think I did this before updater took a dependency on abstutil.
@@ -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) {
