Support other variables than PATH in pathvar (#3791)

* Fix swapped PATH env var separators

* Support pathvar to manipulate other vars than PATH

* Add tests for pathvar and its subcommands

* Fix PATH env name for Windows

Seems like Windows uses PATH as well.

Co-authored-by: Jakub Žádník <jakub.zadnik@tuni.fi>
This commit is contained in:
Jakub Žádník
2021-07-23 10:11:56 +03:00
committed by GitHub
parent d88d7f26e4
commit f9f39c0a1c
10 changed files with 504 additions and 44 deletions

View File

@ -9,15 +9,12 @@ pub struct Outcome {
pub err: String,
}
#[cfg(windows)]
pub const NATIVE_PATH_ENV_VAR: &str = "Path";
#[cfg(not(windows))]
pub const NATIVE_PATH_ENV_VAR: &str = "PATH";
#[cfg(windows)]
pub const NATIVE_PATH_ENV_SEPARATOR: char = ':';
#[cfg(not(windows))]
pub const NATIVE_PATH_ENV_SEPARATOR: char = ';';
#[cfg(not(windows))]
pub const NATIVE_PATH_ENV_SEPARATOR: char = ':';
impl Outcome {
pub fn new(out: String, err: String) -> Outcome {