print a prettier command string

This commit is contained in:
Folkert 2022-12-17 22:21:00 +01:00
parent a522d49558
commit 1d260530fb
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
3 changed files with 15 additions and 13 deletions

View file

@ -5,6 +5,7 @@ extern crate roc_module;
extern crate tempfile;
use roc_utils::cargo;
use roc_utils::pretty_command_string;
use roc_utils::root_dir;
use serde::Deserialize;
use serde_xml_rs::from_str;
@ -447,15 +448,3 @@ pub fn known_bad_file(file_name: &str) -> PathBuf {
path
}
fn pretty_command_string(command: &Command) -> OsString {
let mut command_string = std::ffi::OsString::new();
command_string.push(command.get_program());
for arg in command.get_args() {
command_string.push(" ");
command_string.push(arg);
}
command_string
}

View file

@ -192,7 +192,8 @@ fn cp_unless_zig_cache(src_dir: &Path, target_dir: &Path) -> io::Result<()> {
}
fn run_command(mut command: Command, flaky_fail_counter: usize) {
let command_str = format!("{:?}", &command);
let command_str = roc_utils::pretty_command_string(&command);
let command_str = command_str.to_string_lossy();
let output_result = command.output();

View file

@ -255,3 +255,15 @@ fn check_command_available(command_name: &str) -> bool {
true
}
}
pub fn pretty_command_string(command: &Command) -> std::ffi::OsString {
let mut command_string = std::ffi::OsString::new();
command_string.push(command.get_program());
for arg in command.get_args() {
command_string.push(" ");
command_string.push(arg);
}
command_string
}