aboutsummaryrefslogtreecommitdiff
path: root/xtask
diff options
context:
space:
mode:
authordatdenkikniet <jcdra1@gmail.com>2023-04-16 13:27:46 +0200
committerdatdenkikniet <jcdra1@gmail.com>2023-04-16 13:27:46 +0200
commit319c2263f3cebd5d990ba5fee277ec9cf1b1d2f9 (patch)
treeb0cd66a52d22940e9754bd46dac946c0220a20b6 /xtask
parentbc92e43b113dae2a34db6b10812d84227ac5a6d6 (diff)
Also print extra env variables as cmd_str
Diffstat (limited to 'xtask')
-rw-r--r--xtask/src/cargo_command.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/xtask/src/cargo_command.rs b/xtask/src/cargo_command.rs
index b0102ce..401bab4 100644
--- a/xtask/src/cargo_command.rs
+++ b/xtask/src/cargo_command.rs
@@ -355,6 +355,12 @@ impl core::fmt::Display for CargoCommand<'_> {
impl<'a> CargoCommand<'a> {
pub fn as_cmd_string(&self) -> String {
+ let env = if let Some((key, value)) = self.extra_env() {
+ format!("{key}=\"{value}\" ")
+ } else {
+ format!("")
+ };
+
let cd = if let Some(Some(chdir)) = self.chdir().map(|p| p.to_str()) {
format!("cd {chdir} && ")
} else {
@@ -363,7 +369,7 @@ impl<'a> CargoCommand<'a> {
let executable = self.executable();
let args = self.args().join(" ");
- format!("{cd}{executable} {args}")
+ format!("{env}{cd}{executable} {args}")
}
fn command(&self) -> &'static str {