chore(claude): remove unused sidecar execution code

- Remove unused imports (tauri_plugin_shell modules)
- Delete should_use_sidecar() function
- Delete create_sidecar_command() function
- Clean up dead code related to sidecar process execution
This commit is contained in:
Vivek R
2025-07-28 20:52:57 +05:30
parent fd49a9e2ab
commit 7d34da3783

View File

@@ -9,8 +9,6 @@ use std::time::SystemTime;
use tauri::{AppHandle, Emitter, Manager};
use tokio::process::{Child, Command};
use tokio::sync::Mutex;
use tauri_plugin_shell::ShellExt;
use tauri_plugin_shell::process::CommandEvent;
use regex;
/// Global state to track current Claude process
@@ -266,43 +264,6 @@ fn create_command_with_env(program: &str) -> Command {
tokio_cmd
}
/// Determines whether to use sidecar or system binary execution
fn should_use_sidecar(claude_path: &str) -> bool {
claude_path == "claude-code"
}
/// Creates a sidecar command with the given arguments
fn create_sidecar_command(
app: &AppHandle,
args: Vec<String>,
project_path: &str,
) -> Result<tauri_plugin_shell::process::Command, String> {
let mut sidecar_cmd = app
.shell()
.sidecar("claude-code")
.map_err(|e| format!("Failed to create sidecar command: {}", e))?;
// Add all arguments
sidecar_cmd = sidecar_cmd.args(args);
// Set working directory
sidecar_cmd = sidecar_cmd.current_dir(project_path);
// Pass through proxy environment variables if they exist (only uppercase)
for (key, value) in std::env::vars() {
if key == "HTTP_PROXY"
|| key == "HTTPS_PROXY"
|| key == "NO_PROXY"
|| key == "ALL_PROXY"
{
log::debug!("Setting proxy env var for sidecar: {}={}", key, value);
sidecar_cmd = sidecar_cmd.env(&key, &value);
}
}
Ok(sidecar_cmd)
}
/// Creates a system binary command with the given arguments
fn create_system_command(
claude_path: &str,