Merge pull request #3257 from dotnet/brthor/stop-nuking-latest

stop nuking latest binaries
This commit is contained in:
Bryan Thornbury 2016-05-26 11:56:32 -07:00
commit a365414f01

View file

@ -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(@"(?<version>\d\.\d\.\d)-(?<release>.*)?");
// Delete old version files
AzurePublisherTool.ListBlobs($"{targetContainer}")
.Select(s => s.Replace("/dotnet/", ""))
.Where(s => versionFileRegex.IsMatch(s))
.ToList()
.ForEach(f => AzurePublisherTool.TryDeleteBlob(f));