diff --git a/src/environment.rs b/src/environment.rs index 5688754fe4ba0da32da007035138959ee2bc309b..fad13d903263ecf851a57425104199572676347d 100644 --- a/src/environment.rs +++ b/src/environment.rs @@ -125,7 +125,7 @@ impl PackageManager { for entry in entries { if let Ok(entry) = entry { let name = entry.file_name().into_string().unwrap_or_default(); - if name != "common" { + if name != "common" && !name.starts_with('.') { all_envs.push((name, false, current_user.clone())); } } @@ -340,8 +340,6 @@ impl PackageManager { if let Some(pos) = env_stack.iter().position(|&x| x == name) { if pos == 0 { // If it's the first environment, we can remove it - let new_stack = env_stack[1..].join(":"); - env::set_var("EPKG_ACTIVE_ENV", &new_stack); self.deactivate_environment()?; } else { // If it's in the middle of the stack, return error diff --git a/src/repo.rs b/src/repo.rs index f515cf42f87bd3908e4f23ae9e38b18a66693ac9..b4d1a2631f80cba7cf3ec30c2166c885f84d69d0 100644 --- a/src/repo.rs +++ b/src/repo.rs @@ -13,6 +13,7 @@ use crate::download::*; use crate::parse_requires::*; use crate::io::{load_repodata_index, load_package_json}; use crate::utils::copy_all; +use crate::dirs::find_env_root; impl Repodata { pub fn save_package_provides(&mut self, path: &str) -> Result<()> { @@ -236,7 +237,9 @@ pub fn cache_single_repository(channel_name: &str, repo_name: &str, repo_url: &s } pub fn list_repos() -> Result<()> { - let manager_channel_dir = &dirs().epkg_manager_cache.join("channel"); + let common_env_root = find_env_root("common") + .ok_or_else(|| eyre::eyre!("Common environment not found"))?; + let manager_channel_dir = common_env_root.join("opt/epkg-manager/channel"); if !manager_channel_dir.exists() { return Ok(()); }