From 7ab5b2a8a179c8d82e820fac5e01fa1d33f4b780 Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Sat, 24 Jul 2021 15:45:30 -0300 Subject: [PATCH] Avoid nuget HTTP cache when installing/updating 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 --- src/dotnet-evergreen/Tools.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dotnet-evergreen/Tools.cs b/src/dotnet-evergreen/Tools.cs index 92f983d..6cf2ea0 100644 --- a/src/dotnet-evergreen/Tools.cs +++ b/src/dotnet-evergreen/Tools.cs @@ -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 InstallOrUpdateAsync(string packageId) {