Fix build on *BSD, illumos, etc. (#6456)

* nu-path: use 'linux' code on all non-macOS unix

* nu-command: cfg() the Ps command to platforms it's actually implemented on

* nu-system: cfg() the Ps test to the platforms Ps is implemented on
This commit is contained in:
unrelentingtech
2022-09-01 03:34:26 +03:00
committed by GitHub
parent 4858a9a817
commit b27148d14b
5 changed files with 50 additions and 26 deletions

View File

@ -1,4 +1,4 @@
#[cfg(target_os = "linux")]
#[cfg(all(unix, not(target_os = "macos")))]
use pwd::Passwd;
use std::path::{Path, PathBuf};
@ -45,7 +45,7 @@ fn expand_tilde_with_home(path: impl AsRef<Path>, home: Option<PathBuf>) -> Path
}
}
#[cfg(target_os = "linux")]
#[cfg(all(unix, not(target_os = "macos")))]
fn user_home_dir(username: &str) -> PathBuf {
let passwd = Passwd::from_name(username);
match &passwd.ok() {