aboutsummaryrefslogtreecommitdiff
path: root/src/integration/env.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/integration/env.rs')
-rw-r--r--src/integration/env.rs18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/integration/env.rs b/src/integration/env.rs
index ef946729..3cd1b604 100644
--- a/src/integration/env.rs
+++ b/src/integration/env.rs
@@ -10,6 +10,7 @@ pub(crate) const HERDR_TAB_ID_ENV_VAR: &str = "HERDR_TAB_ID";
pub(crate) const HERDR_WORKSPACE_ID_ENV_VAR: &str = "HERDR_WORKSPACE_ID";
pub(crate) const PI_CODING_AGENT_DIR_ENV_VAR: &str = "PI_CODING_AGENT_DIR";
+pub(crate) const OMP_CONFIG_DIR_ENV_VAR: &str = "PI_CONFIG_DIR";
pub(crate) const CLAUDE_CONFIG_DIR_ENV_VAR: &str = "CLAUDE_CONFIG_DIR";
pub(crate) const CODEX_HOME_ENV_VAR: &str = "CODEX_HOME";
pub(crate) const KIMI_CODE_HOME_ENV_VAR: &str = "KIMI_CODE_HOME";
@@ -29,10 +30,19 @@ pub(crate) fn pi_extension_dir() -> io::Result<PathBuf> {
}
pub(crate) fn omp_extension_dir() -> io::Result<PathBuf> {
- Ok(
- config_dir_from_env_or_home(PI_CODING_AGENT_DIR_ENV_VAR, &[".omp", "agent"])?
- .join("extensions"),
- )
+ if let Some(value) =
+ std::env::var_os(PI_CODING_AGENT_DIR_ENV_VAR).filter(|value| !value.is_empty())
+ {
+ return expand_tilde_path(PathBuf::from(value)).map(|path| path.join("extensions"));
+ }
+
+ let config_dir = std::env::var_os(OMP_CONFIG_DIR_ENV_VAR)
+ .filter(|value| !value.is_empty())
+ .unwrap_or_else(|| ".omp".into());
+ Ok(home_dir()?
+ .join(config_dir)
+ .join("agent")
+ .join("extensions"))
}
pub(crate) fn claude_dir() -> io::Result<PathBuf> {