- fix(ci): restore frontend formatting and Linux clippy

- Format Claude Desktop provider presets with Prettier

- Gate platform-specific Claude Desktop path helpers behind cfg
This commit is contained in:
Jason
2026-05-10 22:31:47 +08:00
parent 50a873ca24
commit e45470cd91
2 changed files with 10 additions and 21 deletions
+6 -1
View File
@@ -3,7 +3,9 @@ use serde_json::{json, Value};
use std::fs;
use std::path::{Path, PathBuf};
use crate::config::{atomic_write, delete_file, get_home_dir, read_json_file, write_json_file};
#[cfg(any(target_os = "macos", windows))]
use crate::config::get_home_dir;
use crate::config::{atomic_write, delete_file, read_json_file, write_json_file};
use crate::database::Database;
use crate::database::CLAUDE_DESKTOP_OFFICIAL_PROVIDER_ID;
use crate::error::AppError;
@@ -12,7 +14,9 @@ use crate::provider::{ClaudeDesktopMode, Provider};
pub const PROFILE_ID: &str = "00000000-0000-4000-8000-000000157210";
pub const PROFILE_NAME: &str = "CC Switch";
#[cfg(any(target_os = "macos", windows, test))]
const CONFIG_FILE: &str = "claude_desktop_config.json";
#[cfg(any(target_os = "macos", windows, test))]
const CONFIG_LIBRARY_DIR: &str = "configLibrary";
const GATEWAY_TOKEN_SETTING_KEY: &str = "claude_desktop_gateway_token";
const CLAUDE_DESKTOP_PROXY_PREFIX: &str = "/claude-desktop";
@@ -958,6 +962,7 @@ fn pick_windows_claude_dir(local_app_data: &Path, threep: bool) -> Option<PathBu
candidates.into_iter().next()
}
#[cfg(any(target_os = "macos", windows, test))]
fn paths_from_dirs(normal_dir: PathBuf, threep_dir: PathBuf) -> ClaudeDesktopPaths {
let config_library_path = threep_dir.join(CONFIG_LIBRARY_DIR);
let profile_path = config_library_path.join(format!("{PROFILE_ID}.json"));