mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
Handle env vars in debug printing
This commit is contained in:
parent
26fdbaf4cd
commit
0f19ecbb86
1 changed files with 14 additions and 0 deletions
|
@ -1436,8 +1436,22 @@ fn run_build_command(mut command: Command, file_to_build: &str, flaky_fail_count
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Stringify a command for printing
|
||||||
|
/// e.g. `HOME=~ zig build-exe foo.zig -o foo`
|
||||||
fn stringify_command(cmd: &Command) -> String {
|
fn stringify_command(cmd: &Command) -> String {
|
||||||
let mut command_string = std::ffi::OsString::new();
|
let mut command_string = std::ffi::OsString::new();
|
||||||
|
|
||||||
|
for (name, opt_val) in cmd.get_envs() {
|
||||||
|
command_string.push(name);
|
||||||
|
command_string.push("=");
|
||||||
|
if let Some(val) = opt_val {
|
||||||
|
command_string.push(val);
|
||||||
|
} else {
|
||||||
|
command_string.push("''");
|
||||||
|
}
|
||||||
|
command_string.push(" ");
|
||||||
|
}
|
||||||
|
|
||||||
command_string.push(cmd.get_program());
|
command_string.push(cmd.get_program());
|
||||||
|
|
||||||
for arg in cmd.get_args() {
|
for arg in cmd.get_args() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue