diff --git a/plugins/hooks/Cargo.toml b/plugins/hooks/Cargo.toml index dd9b07fd75..778839b1e8 100644 --- a/plugins/hooks/Cargo.toml +++ b/plugins/hooks/Cargo.toml @@ -30,3 +30,5 @@ futures-util = { workspace = true } shellexpand = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true, features = ["process", "time"] } + +tauri-plugin-path2 = { path = "../path2" } diff --git a/plugins/hooks/src/config.rs b/plugins/hooks/src/config.rs index e62b3748e0..399b7af8e8 100644 --- a/plugins/hooks/src/config.rs +++ b/plugins/hooks/src/config.rs @@ -2,6 +2,8 @@ use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::path::PathBuf; +use tauri_plugin_path2::Path2PluginExt; + /// Configuration for hook execution. #[derive(Debug, Clone, Serialize, Deserialize, specta::Type)] pub struct HooksConfig { @@ -48,12 +50,12 @@ impl HooksConfig { } fn config_path(app: &impl tauri::Manager) -> crate::Result { - let data_dir = app - .path() - .data_dir() + let base = app + .path2() + .base() .map_err(|e| crate::Error::ConfigLoad(e.to_string()))?; - Ok(data_dir.join("hyprnote").join("settings.json")) + Ok(base.join("settings.json")) } fn empty() -> Self {