Skip to content

Commit

Permalink
Remove duplicate entries from dotnet --info (#60376) (#60496)
Browse files Browse the repository at this point in the history
* Remove duplicate entries from dotnet --info

* Remove trailing slashes from globally registered locations as well

* PR feedback

* Tests not ported due to missing infrastructure

Co-authored-by: vitek-karas <[email protected]>

Co-authored-by: vitek-karas <[email protected]>
  • Loading branch information
ericstj and vitek-karas authored Oct 22, 2021
1 parent d1a6945 commit 47b7c1d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/installer/corehost/cli/hostmisc/pal.windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,14 @@ bool pal::get_global_dotnet_dirs(std::vector<pal::string_t>* dirs)
bool dir_found = false;
if (pal::get_dotnet_self_registered_dir(&custom_dir))
{
remove_trailing_dir_seperator(&custom_dir);
dirs->push_back(custom_dir);
dir_found = true;
}
if (get_default_installation_dir(&default_dir))
{
remove_trailing_dir_seperator(&default_dir);

// Avoid duplicate global dirs.
if (!dir_found || !are_paths_equal_with_normalized_casing(custom_dir, default_dir))
{
Expand Down

0 comments on commit 47b7c1d

Please sign in to comment.