From 030f5fbae4f1805019fa24ce68876fadec258537 Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sun, 21 Jul 2019 21:58:35 +0800 Subject: [PATCH] update get_home( --- src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index c5a2c78..a409474 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -38,7 +38,10 @@ pub fn is_macos_or_linux() -> bool { } pub fn get_home() -> Option { - env::var("HOME").ok() + match is_macos_or_linux() { + true => env::var("HOME").ok(), + false => None, + } } pub fn get_absolute_path(path: &str) -> Option {