Skip to content

Commit

Permalink
Avoid nuget HTTP cache when installing/updating
Browse files Browse the repository at this point in the history
The nuget cache is used heavily when installing or updating tools. It's not unusual for a recently published package (which does show up in our explicit check against the feed) to fail to install the latest version if a locally cached version exists too.

Since we check for updates against the actual remote feed, we know when there's an update, and the cache can get in the way of consistency here. We therefore pass `--no-cache` when running install/update commands.

Fixes #6
  • Loading branch information
kzu committed Jul 24, 2021
1 parent 3f25988 commit 7ab5b2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dotnet-evergreen/Tools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ public Tools(string dotnet, string packageFeed = DefaultPackageFeed)
}

public bool Install(string packageId)
=> Process.Start(dotnet, "tool install -g " + feedArg + packageId).WaitForExitCode() == 0 && Refresh();
=> Process.Start(dotnet, "tool install -g --no-cache " + feedArg + packageId).WaitForExitCode() == 0 && Refresh();

public bool Update(string packageId)
=> Process.Start(dotnet, "tool update -g " + feedArg + packageId).WaitForExitCode() == 0 && Refresh();
=> Process.Start(dotnet, "tool update -g --no-cache " + feedArg + packageId).WaitForExitCode() == 0 && Refresh();

public async Task<bool> InstallOrUpdateAsync(string packageId)
{
Expand Down

0 comments on commit 7ab5b2a

Please sign in to comment.