mirror of
https://github.com/nushell/nushell
synced 2025-01-27 12:25:19 +00:00
if cfg\!(windows) { ... } else { ... } not very compatible, rollback to #[cfg(windows)] ... #[cfg(not(windows))] ...
This commit is contained in:
parent
4497b698ee
commit
3e17077679
2 changed files with 10 additions and 4 deletions
|
@ -694,11 +694,14 @@ pub fn is_automatic_env_var(var: &str, ignore_case: bool) -> bool {
|
|||
|
||||
let names = AUTOMATIC_ENV_VAR_NAMES.get_or_init(|| {
|
||||
let base_names = vec!["PWD".into(), "FILE_PWD".into(), "CURRENT_FILE".into()];
|
||||
if cfg!(windows) {
|
||||
#[cfg(windows)]
|
||||
{
|
||||
let mut extended_names = base_names;
|
||||
extend_automatic_env_vars(&mut extended_names);
|
||||
extended_names
|
||||
} else {
|
||||
}
|
||||
#[cfg(not(windows))]
|
||||
{
|
||||
base_names
|
||||
}
|
||||
});
|
||||
|
|
|
@ -768,9 +768,12 @@ impl Stack {
|
|||
let path = nu_path::strip_trailing_slash(path);
|
||||
let value = Value::string(path.to_string_lossy(), Span::unknown());
|
||||
self.add_env_var("PWD".into(), value);
|
||||
if cfg!(windows) {
|
||||
#[cfg(windows)]
|
||||
{
|
||||
fetch_result(self)
|
||||
} else {
|
||||
}
|
||||
#[cfg(not(windows))]
|
||||
{
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue