mirror of
https://github.com/priyanshujain/margin-docs.git
synced 2026-10-02 11:07:05 +00:00
10 lines
272 B
Rust
10 lines
272 B
Rust
use std::fs;
|
|
use std::path::PathBuf;
|
|
use tauri::Manager;
|
|
|
|
pub fn app_data_dir(app: &tauri::AppHandle) -> Result<PathBuf, String> {
|
|
let dir = app.path().app_data_dir().map_err(|e| e.to_string())?;
|
|
fs::create_dir_all(&dir).map_err(|e| e.to_string())?;
|
|
Ok(dir)
|
|
}
|