Link command WIP
This commit is contained in:
18
src/utils/folder.rs
Normal file
18
src/utils/folder.rs
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user