diff options
-rw-r--r-- | launcher/.idea/vcs.xml | 1 | ||||
-rw-r--r-- | launcher/src/main.rs | 23 |
2 files changed, 13 insertions, 11 deletions
diff --git a/launcher/.idea/vcs.xml b/launcher/.idea/vcs.xml index 35eb1dd..62bd7a0 100644 --- a/launcher/.idea/vcs.xml +++ b/launcher/.idea/vcs.xml @@ -2,5 +2,6 @@ <project version="4"> <component name="VcsDirectoryMappings"> <mapping directory="" vcs="Git" /> + <mapping directory="$PROJECT_DIR$/.." vcs="Git" /> </component> </project>
\ No newline at end of file diff --git a/launcher/src/main.rs b/launcher/src/main.rs index 6f3e21c..28813f6 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -4,29 +4,30 @@ use std::process::{Command, exit}; use dirs::home_dir; use rustc_version_runtime::version; -fn get_home() -> String { - let home_buf = home_dir() - .unwrap_or(PathBuf::from("/")); - let os_string = home_buf - .into_os_string(); - os_string - .to_string_lossy() - .to_string() +fn get_home() -> PathBuf { + home_dir() + .unwrap_or(PathBuf::from("/")) } #[cfg(target_os = "macos")] fn get_home_search() -> PathBuf { - PathBuf::from(format!("{}/Library/Frameworks/AtomicRuntime.framework", get_home())) + PathBuf::from(format!("{}/Library/Frameworks/AtomicRuntime.framework", get_home() + .to_str() + .unwrap_or("/"))) } #[cfg(target_os = "linux")] fn get_home_search() -> PathBuf { - PathBuf::from(format!("{}/.local/share/atomic-runtime", get_home())) + PathBuf::from(format!("{}/.local/share/atomic-runtime", get_home() + .to_str() + .unwrap_or("/"))) } #[cfg(target_os = "windows")] fn get_home_search() -> PathBuf { - PathBuf::from(format!("{}\\AppData\\Local\\Atomic Runtime", get_home())) + PathBuf::from(format!("{}\\AppData\\Local\\Atomic Runtime", get_home() + .to_str() + .unwrap_or("/"))) } #[cfg(target_os = "macos")] |