mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-27 15:03:20 +03:00
Dedupe must_run_cmd. I think I did this before updater took a dependency on abstutil.
This commit is contained in:
parent
30dc328f06
commit
9ddf658e96
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user