forked from extern/nushell
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:
@ -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 {
|
||||
|
Reference in New Issue
Block a user