Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions plugins/hooks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
10 changes: 6 additions & 4 deletions plugins/hooks/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -48,12 +50,12 @@ impl HooksConfig {
}

fn config_path<R: tauri::Runtime>(app: &impl tauri::Manager<R>) -> crate::Result<PathBuf> {
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 {
Expand Down