2023-03-20 17:36:15 +00:00
|
|
|
use std::path::PathBuf;
|
|
|
|
|
|
|
|
pub fn get_data_dir() -> Option<PathBuf> {
|
|
|
|
dirs::data_dir().map(|f| f.join("tfclient/"))
|
2023-03-21 17:00:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_config_dir(instance: &str) -> Option<PathBuf> {
|
|
|
|
dirs::config_dir().map(|f| f.join("tfclient/").join(format!("{}/", instance)))
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_config_file(instance: &str) -> Option<PathBuf> {
|
|
|
|
get_config_dir(instance).map(|f| f.join("tfclient.toml"))
|
2023-03-23 17:50:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_cdata_dir(instance: &str) -> Option<PathBuf> {
|
|
|
|
dirs::config_dir().map(|f| f.join("tfclient_data/").join(format!("{}/", instance)))
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_cdata_file(instance: &str) -> Option<PathBuf> {
|
|
|
|
get_cdata_dir(instance).map(|f| f.join("tfclient.toml"))
|
2023-03-29 22:44:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_nebulaconfig_file(instance: &str) -> Option<PathBuf> {
|
|
|
|
get_cdata_dir(instance).map(|f| f.join("nebula.sk_embedded.yml"))
|
2023-05-14 17:47:49 +00:00
|
|
|
}
|