use std::path::{Path, PathBuf};
use crate::constants::home_dir_or_fallback;
fn legacy_paths_under(home: &Path) -> Vec<PathBuf> {
let claude = home.join(".claude");
vec![
claude.join("skills").join("gw"),
claude.join("skills").join("gw-delegate"),
claude.join("plugins").join("gw"),
]
}
pub fn any_legacy_present() -> bool {
any_legacy_present_under(&home_dir_or_fallback())
}
pub fn any_legacy_present_under(home: &Path) -> bool {
legacy_paths_under(home).iter().any(|p| p.exists())
}
pub fn remove_legacy_installs_under(home: &Path) {
for p in legacy_paths_under(home) {
if p.exists() {
let _ = std::fs::remove_dir_all(&p);
}
}
}