From 11ecbd83f32b517c07245090e5464ab6fede7e81 Mon Sep 17 00:00:00 2001 From: Eddy Date: Mon, 13 Apr 2026 20:43:01 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20withGlobalTauri=20+=20Bridge-Pfadsuche?= =?UTF-8?q?=20f=C3=BCr=20Dev-Modus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - tauri.conf.json: withGlobalTauri: true — behebt 'invoke undefined' - claude.rs: Bridge-Script in 3 Pfaden suchen (Binary-Dir, Cargo-Manifest, CWD) Co-Authored-By: Claude Opus 4.6 (1M context) --- src-tauri/src/claude.rs | 20 +++++++++++++------- src-tauri/tauri.conf.json | 1 + 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src-tauri/src/claude.rs b/src-tauri/src/claude.rs index 631542a..733b38b 100644 --- a/src-tauri/src/claude.rs +++ b/src-tauri/src/claude.rs @@ -77,13 +77,19 @@ pub fn start_bridge(app: &AppHandle) -> Result<(), String> { .ok_or("Kein Parent-Verzeichnis")? .to_path_buf(); - let script_path = exe_dir.join("scripts").join("claude-bridge.js"); - let script_path = if script_path.exists() { - script_path - } else { - // Fallback für Entwicklung - std::path::PathBuf::from("scripts/claude-bridge.js") - }; + // Script in mehreren Pfaden suchen + let candidates = vec![ + exe_dir.join("scripts").join("claude-bridge.js"), + // Entwicklung: relativ zum Cargo-Manifest + std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../scripts/claude-bridge.js"), + // Fallback: CWD + std::env::current_dir().unwrap_or_default().join("scripts/claude-bridge.js"), + ]; + + let script_path = candidates.iter() + .find(|p| p.exists()) + .cloned() + .ok_or_else(|| format!("claude-bridge.js nicht gefunden. Gesucht in: {:?}", candidates))?; println!("🔌 Starte Claude Bridge: {:?}", script_path); diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index dcbc9b3..bb6cfbb 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -24,6 +24,7 @@ "center": true } ], + "withGlobalTauri": true, "security": { "csp": null }