Skip to content

Commit

Permalink
Fix Yaml source printers
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoinePrv committed Nov 2, 2023
1 parent 96ebf0f commit 2b69b1e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions libmamba/src/api/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ namespace mamba
void custom_channels_hook(std::map<std::string, std::string>& custom_channels)
{
// Hard coded Anaconda channels names.
// This will redefine them if the user has already defined these keys.
// This will not redefine them if the user has already defined these keys.
custom_channels.emplace("pkgs/main", "https://repo.anaconda.com/pkgs/main");
custom_channels.emplace("pkgs/r", "https://repo.anaconda.com/pkgs/r");
custom_channels.emplace("pkgs/pro", "https://repo.anaconda.com/pkgs/pro");
Expand Down Expand Up @@ -1020,7 +1020,14 @@ namespace mamba
out << YAML::BeginSeq;
for (std::size_t n = 0; n < value.size(); ++n)
{
print_node(out, value[n], source[n], show_source);
if (source.IsSequence() && (source.size() == value.size()))
{
print_node(out, value[n], source[n], show_source);
}
else
{
print_node(out, value[n], source, show_source);
}
}
out << YAML::EndSeq;
}
Expand Down

0 comments on commit 2b69b1e

Please sign in to comment.