From 97fa92c911490efb04dfe3cb6a1b62d302194bc2 Mon Sep 17 00:00:00 2001 From: Firefly0619sec Date: Fri, 23 Oct 2026 19:49:03 +0800 Subject: [PATCH] fix(hooks): skip bash syntax check on Windows --- src-tauri/src/commands/claude.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src-tauri/src/commands/claude.rs b/src-tauri/src/commands/claude.rs index 529eb1a2a..d2e96b233 100644 --- a/src-tauri/src/commands/claude.rs +++ b/src-tauri/src/commands/claude.rs @@ -2163,6 +2163,16 @@ pub async fn update_hooks_config( pub async fn validate_hook_command(command: String) -> Result { log::info!("Validating hook command syntax"); + // `bash -n` is not available on Windows. Skip the syntax check there + // instead of failing validation with "program not found". + if cfg!(target_os = "windows") { + let _ = &command; + return Ok(serde_json::json!({ + "valid": true, + "message": "Syntax check is not available on Windows; skipping" + })); + } + // Validate syntax without executing let mut cmd = std::process::Command::new("bash"); cmd.arg("-n") // Syntax check only