add more condarc paths (#3695)

This commit is contained in:
Sandrine Pataut 2025-01-10 11:45:59 +01:00 committed by GitHub
parent f3c7c7797e
commit 30546a3957
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 19 additions and 0 deletions

View File

@ -2065,6 +2065,25 @@ namespace mamba
fs::u8path(util::user_home_dir()) / ".conda/condarc.d", fs::u8path(util::user_home_dir()) / ".conda/condarc.d",
fs::u8path(util::user_home_dir()) / ".condarc", 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")) if (util::get_env("CONDARC"))
{ {
conda_user.push_back(fs::u8path(util::get_env("CONDARC").value())); conda_user.push_back(fs::u8path(util::get_env("CONDARC").value()));