Skip to content

Commit

Permalink
add more condarc paths
Browse files Browse the repository at this point in the history
  • Loading branch information
SandrineP committed Dec 17, 2024
1 parent 4cbb3f7 commit b0b2e3e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions libmamba/src/api/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2048,6 +2048,25 @@ namespace mamba
fs::u8path(util::user_home_dir()) / ".conda/condarc.d",
fs::u8path(util::user_home_dir()) / ".condarc",
};

std::array<std::string, 3> 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()));
Expand Down

0 comments on commit b0b2e3e

Please sign in to comment.