Skip to content

Commit

Permalink
Better snap support, fix dotnet#1753
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyAkinshin committed Aug 13, 2021
1 parent 74e3c4f commit 1a8296f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ private static string GetDefaultDotNetCliPath()
{
string parentPath = parentProcess.MainModule?.FileName ?? string.Empty;
// sth like /snap/dotnet-sdk/112/dotnet and we should use the exact path instead of just "dotnet"
if (parentPath.StartsWith("/snap/", StringComparison.Ordinal))
if (parentPath.StartsWith("/snap/", StringComparison.Ordinal) &&
parentPath.EndsWith("/dotnet", StringComparison.Ordinal))
{
return parentPath;
}
Expand Down

0 comments on commit 1a8296f

Please sign in to comment.