mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-06-29 09:55:56 +08:00
fix: 架构审查修复 — broadcast、目标校验、import_csv 警告、workspace 元数据统一
- HIGH: CLI 所有修改命令补 broadcast_env_change() - HIGH: --system/--user 互斥校验,不再静默忽略 - MEDIUM: gui/Cargo.toml 删冗余 serde_json(log 保留,lib.rs 实际使用) - MEDIUM: import_csv 对跳过行输出 log::warn - MEDIUM: ProfilePathEntry 从 core 重导出 - LOW: Cargo workspace.package 统一元数据 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+4
-4
@@ -1,10 +1,10 @@
|
||||
[package]
|
||||
name = "path-editor-core"
|
||||
version = "5.0.0"
|
||||
description = "PathEditor core library — shared between GUI and CLI"
|
||||
authors = ["刘航宇"]
|
||||
license = "MIT"
|
||||
edition = "2021"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
|
||||
+7
-3
@@ -36,13 +36,17 @@ fn import_csv(content: &str) -> Result<(Vec<String>, Vec<String>), String> {
|
||||
let mut sys = Vec::new();
|
||||
let mut usr = Vec::new();
|
||||
for line in content.lines() {
|
||||
let fields: Vec<&str> = line.split(',').collect();
|
||||
let trimmed = line.trim();
|
||||
if trimmed.is_empty() { continue; }
|
||||
let fields: Vec<&str> = trimmed.split(',').collect();
|
||||
if fields.len() >= 2 {
|
||||
match fields[0].trim() {
|
||||
match fields[0].trim().to_lowercase().as_str() {
|
||||
"system" | "sys" => sys.push(fields[1].trim().to_string()),
|
||||
"user" | "usr" => usr.push(fields[1].trim().to_string()),
|
||||
_ => {}
|
||||
_ => { log::warn!("import_csv: 无法识别的类型字段,已跳过: {trimmed}"); }
|
||||
}
|
||||
} else {
|
||||
log::warn!("import_csv: 格式不正确(缺逗号),已跳过: {trimmed}");
|
||||
}
|
||||
}
|
||||
if sys.is_empty() && usr.is_empty() {
|
||||
|
||||
+1
-1
@@ -6,5 +6,5 @@ pub mod registry;
|
||||
pub mod scanner;
|
||||
pub mod system;
|
||||
|
||||
pub use profiles::{ProfileData, ProfileMeta};
|
||||
pub use profiles::{ProfileData, ProfileMeta, ProfilePathEntry};
|
||||
pub use scanner::{ConflictEntry, ConflictLocation, ToolGroup};
|
||||
|
||||
Reference in New Issue
Block a user