Link command WIP

This commit is contained in:
2023-03-15 16:22:19 +01:00
parent 5fe8a29842
commit 1eaf759599
16 changed files with 500 additions and 0 deletions

18
src/utils/folder.rs Normal file
View File

@@ -0,0 +1,18 @@
use std::path::Path;
const APPLICATION_SUBFOLDER_NAME: &str = "alma";
pub fn get_config_home_path() -> String {
let config_home_path = std::env::var("XDG_CONFIG_HOME")
.map_or_else(
|_| {
let home_path = std::env::var("HOME").unwrap();
Path::new(&home_path).join(".config")
},
|c| Path::new(&c).to_path_buf(),
)
.join(APPLICATION_SUBFOLDER_NAME)
.display()
.to_string();
return config_home_path;
}