2021-12-14 11:07:15 +03:00
|
|
|
use std::path::{Path, PathBuf};
|
|
|
|
use tauri::{
|
|
|
|
api::path::{home_dir, resource_dir},
|
2022-02-13 13:45:03 +03:00
|
|
|
Env, PackageInfo,
|
2021-12-14 11:07:15 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/// get the verge app home dir
|
|
|
|
pub fn app_home_dir() -> PathBuf {
|
|
|
|
home_dir()
|
|
|
|
.unwrap()
|
|
|
|
.join(Path::new(".config"))
|
|
|
|
.join(Path::new("clash-verge"))
|
|
|
|
}
|
|
|
|
|
|
|
|
/// get the resources dir
|
|
|
|
pub fn app_resources_dir(package_info: &PackageInfo) -> PathBuf {
|
2022-02-13 13:45:03 +03:00
|
|
|
resource_dir(package_info, &Env::default())
|
|
|
|
.unwrap()
|
|
|
|
.join("resources")
|
2021-12-14 11:07:15 +03:00
|
|
|
}
|