Revert code style changes#244
Merged
YuliiaKovalova merged 3 commits intomicrosoft:masterfrom Sep 19, 2023
Merged
Conversation
ladipro
approved these changes
Sep 18, 2023
dibarbet
approved these changes
Sep 18, 2023
lifengl
suggested changes
Sep 18, 2023
| && Path.GetFileName(dotnetExePath).Equals(ExeName, StringComparison.InvariantCultureIgnoreCase); | ||
|
|
||
| if (isRunFromDotnetExecutable) | ||
| { |
Member
There was a problem hiding this comment.
We still lost some fixes here, the issue is DOTNET_HOST_PATH points to the dotnet executable, so it cannot be done the same way as other environment variables pointing to a directory.
in the code lost in the last Style PR, the code looks like this ( I guess it needs to be integrated back as the logic is now different. Basically, it needs to handle symbol link, and then get the directory containing the file
// DOTNET_HOST_PATH is pointing to the file, DOTNET_ROOT is the path of the folder
string? hostPath = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH");
if (!string.IsNullOrEmpty(hostPath) && File.Exists(hostPath))
{
if (!IsWindows)
{
hostPath = realpath(hostPath) ?? hostPath;
}
dotnetPath = Path.GetDirectoryName(hostPath);
if (dotnetPath is not null)
{
// don't overwrite DOTNET_HOST_PATH, if we use it.
return dotnetPath;
}
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Revert code style changes + undo all extra changes in DotNetSdkLocationHelper