Initial commit
This commit is contained in:
21
src/agents.rs
Normal file
21
src/agents.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use std::env;
|
||||
use std::path::PathBuf;
|
||||
|
||||
pub fn agent_rw_paths() -> Vec<PathBuf> {
|
||||
let home = match env::var("HOME") {
|
||||
Ok(h) => PathBuf::from(h),
|
||||
Err(_) => return vec![],
|
||||
};
|
||||
|
||||
let candidates = [
|
||||
env::var("CLAUDE_CONFIG_DIR")
|
||||
.map(PathBuf::from)
|
||||
.unwrap_or_else(|_| home.join(".claude")),
|
||||
env::var("CODEX_HOME")
|
||||
.map(PathBuf::from)
|
||||
.unwrap_or_else(|_| home.join(".codex")),
|
||||
home.join(".pi"),
|
||||
];
|
||||
|
||||
candidates.into_iter().filter(|p| p.is_dir()).collect()
|
||||
}
|
||||
Reference in New Issue
Block a user