refactor: allow custom location

This commit is contained in:
zhom
2026-02-21 16:32:46 +04:00
parent 1afc2ca5ff
commit 206be3ff12
17 changed files with 230 additions and 327 deletions
+1 -10
View File
@@ -1,4 +1,3 @@
use directories::BaseDirs;
use serde::{Deserialize, Serialize};
use std::fs;
use std::path::PathBuf;
@@ -35,15 +34,7 @@ impl ProxyConfig {
}
pub fn get_storage_dir() -> PathBuf {
let base_dirs = BaseDirs::new().expect("Failed to get base directories");
let mut path = base_dirs.data_local_dir().to_path_buf();
path.push(if cfg!(debug_assertions) {
"DonutBrowserDev"
} else {
"DonutBrowser"
});
path.push("proxies");
path
crate::app_dirs::proxies_dir()
}
pub fn save_proxy_config(config: &ProxyConfig) -> Result<(), Box<dyn std::error::Error>> {