From b0b2e3eaed0b960fd5f132e6edf5c85cab84ee75 Mon Sep 17 00:00:00 2001 From: Sandrine Pataut Date: Tue, 17 Dec 2024 14:48:41 +0100 Subject: [PATCH] add more condarc paths --- libmamba/src/api/configuration.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libmamba/src/api/configuration.cpp b/libmamba/src/api/configuration.cpp index 946992aaf6..c29bbbb4c5 100644 --- a/libmamba/src/api/configuration.cpp +++ b/libmamba/src/api/configuration.cpp @@ -2048,6 +2048,25 @@ namespace mamba fs::u8path(util::user_home_dir()) / ".conda/condarc.d", fs::u8path(util::user_home_dir()) / ".condarc", }; + + std::array condarc_list = {"/.condarc", "/condarc", "/condarc.d"}; + if (util::get_env("XDG_CONFIG_HOME")) + { + const std::string xgd_config_home = util::get_env("XDG_CONFIG_HOME").value(); + for (const auto& path: condarc_list) + { + conda_user.push_back(fs::u8path(xgd_config_home) + "/conda" + path); + } + } + if (util::get_env("CONDA_PREFIX")) + { + const std::string conda_prefix = util::get_env("CONDA_PREFIX").value(); + for (const auto& path: condarc_list) + { + conda_user.push_back(fs::u8path(conda_prefix) + path); + } + } + if (util::get_env("CONDARC")) { conda_user.push_back(fs::u8path(util::get_env("CONDARC").value()));