Skip to content

Commit

Permalink
RCCEnvironment: Take environment variables into account when wrappi…
Browse files Browse the repository at this point in the history
…ng command
  • Loading branch information
jherbel committed Dec 10, 2024
1 parent 74e8126 commit 10a5b8e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ impl RCCEnvironment {
.add_argument("--")
.add_argument(command_spec.executable)
.add_arguments(command_spec.arguments);
for (key, value) in command_spec.envs_rendered_plain {
wrapped_spec.add_plain_env(key, value);
}
for (key, value) in command_spec.envs_rendered_obfuscated {
wrapped_spec.add_obfuscated_env(key, value);
}
wrapped_spec
}

Expand Down Expand Up @@ -262,6 +268,9 @@ mod tests {
.add_argument("--option")
.add_argument("option_value");
command_spec
.add_plain_env("PLAIN_KEY", "PLAIN_VALUE")
.add_obfuscated_env("OBFUSCATED_KEY", "OBFUSCATED_VALUE");
command_spec
}

#[test]
Expand Down Expand Up @@ -292,7 +301,9 @@ mod tests {
.add_argument("--flag")
.add_argument("--option")
.add_argument("option_value")
.add_plain_env("ROBOCORP_HOME", "~/.robocorp/");
.add_plain_env("ROBOCORP_HOME", "~/.robocorp/")
.add_plain_env("PLAIN_KEY", "PLAIN_VALUE")
.add_obfuscated_env("OBFUSCATED_KEY", "OBFUSCATED_VALUE");
assert_eq!(
RCCEnvironment {
binary_path: Utf8PathBuf::from("C:\\bin\\z.exe"),
Expand Down

0 comments on commit 10a5b8e

Please sign in to comment.