Skip to content

Commit

Permalink
changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
sagiegurari committed May 20, 2021
1 parent 05b5847 commit d2021eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## CHANGELOG

### v0.8.0 (2021-05-20)

* Support providing environment variables to script process #16 (thanks @kenr)

### v0.7.0 (2021-03-09)

* Make script error chainable.
Expand Down
5 changes: 5 additions & 0 deletions src/runner_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,23 +369,28 @@ fn run_or_exit_append_env() {
env_vars.insert("MY_TEST_VARIABLE".to_string(), "MY_TEST_VALUE".to_string());
options.env_vars = Some(env_vars);

std::env::set_var("PARENT_VAR", "PARENT_VALUE");

let script: String;

if cfg!(windows) {
script = r#"
ECHO %MY_TEST_VARIABLE%
ECHO %PARENT_VAR%
"#
.to_string();
} else {
script = r#"
echo $MY_TEST_VARIABLE
echo $PARENT_VAR
"#
.to_string()
}

let (output, error) = run_or_exit(&script, &args, &options);

assert!(output.contains("MY_TEST_VALUE"));
assert!(output.contains("PARENT_VALUE"));
assert!(error.is_empty());

// Check if current environment is polluted
Expand Down

0 comments on commit d2021eb

Please sign in to comment.