Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,13 @@ internal static string[] GetDefaultProbeDirectories(Platform osPlatform, IEnviro
return new string[] { packageDirectory };
}

string basePath;
if (osPlatform == Platform.Windows)
{
basePath = environment.GetEnvironmentVariable("USERPROFILE");
}
else
{
basePath = environment.GetEnvironmentVariable("HOME");
}

string basePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
if (string.IsNullOrEmpty(basePath))
{
return new string[] { string.Empty };
}

return new string[] { Path.Combine(basePath, ".nuget", "packages") };

}

public bool TryResolveAssemblyPaths(CompilationLibrary library, List<string> assemblies)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,7 @@ static List<string> GetDefaultProbeDirectories(Platform osPlatform, IMessageSink
results.Add(packageDirectory);
else
{
string basePath;
if (osPlatform == Platform.Windows)
basePath = Environment.GetEnvironmentVariable("USERPROFILE");
else
basePath = Environment.GetEnvironmentVariable("HOME");

string basePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
if (!string.IsNullOrEmpty(basePath))
results.Add(Path.Combine(basePath, ".nuget", "packages"));
}
Expand Down
Loading