From 66381098ddaef1424002d04d69b729f11368e419 Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Thu, 26 May 2016 10:20:14 -0700 Subject: [PATCH] stop nuking latest binaries --- build_projects/dotnet-cli-build/PublishTargets.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build_projects/dotnet-cli-build/PublishTargets.cs b/build_projects/dotnet-cli-build/PublishTargets.cs index 74cbf6619..a3e908f0a 100644 --- a/build_projects/dotnet-cli-build/PublishTargets.cs +++ b/build_projects/dotnet-cli-build/PublishTargets.cs @@ -73,9 +73,12 @@ namespace Microsoft.DotNet.Cli.Build } else { - // This is an old drop of latest so remove all old files to ensure a clean state + Regex versionFileRegex = new Regex(@"(?\d\.\d\.\d)-(?.*)?"); + + // Delete old version files AzurePublisherTool.ListBlobs($"{targetContainer}") .Select(s => s.Replace("/dotnet/", "")) + .Where(s => versionFileRegex.IsMatch(s)) .ToList() .ForEach(f => AzurePublisherTool.TryDeleteBlob(f));