We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d047d76 commit 8641923Copy full SHA for 8641923
src/utils.rs
@@ -6,9 +6,8 @@ pub(crate) fn get_home_dir() -> Option<String> {
6
// This function is required when `glob_tilde_expansion` field of `glob::MatchOptions` is
7
// set `true` and pattern starts with `~` followed by any char expect `/`
8
pub(crate) fn get_user_name() -> Option<String> {
9
- if cfg!(target_os = "linux") {
10
- std::env::var("USER").ok()
11
- } else {
12
- None
13
- }
+ #[cfg(not(target_os = "windows"))]
+ return std::env::var("USER").ok();
+ #[cfg(target_os = "windows")]
+ std::env::var("USERNAME").ok()
14
}
0 commit comments