diff --git a/tools/VersionController/Program.cs b/tools/VersionController/Program.cs index c44f76c9f58a..6e256a25493d 100644 --- a/tools/VersionController/Program.cs +++ b/tools/VersionController/Program.cs @@ -166,12 +166,15 @@ private static void BumpVersions() changedModules.AddRange(changeLogs); } + // Read MinimalVersion.csv var executingAssemblyPath = Assembly.GetExecutingAssembly().Location; var versionControllerDirectory = Directory.GetParent(executingAssemblyPath).FullName; var miniVersionFile = Path.Combine(versionControllerDirectory, "MinimalVersion.csv"); if (File.Exists(miniVersionFile)) { - var lines = File.ReadAllLines(miniVersionFile).Skip(1).Where(c => !string.IsNullOrEmpty(c)); + var file = File.ReadAllLines(miniVersionFile); + var header = file.First(); + var lines = file.Skip(1).Where(c => !string.IsNullOrEmpty(c)); foreach (var line in lines) { var cols = line.Split(",").Select(c => c.StartsWith("\"") ? c.Substring(1) : c) @@ -182,7 +185,11 @@ private static void BumpVersions() _minimalVersion.Add(cols[0], new AzurePSVersion(cols[1])); } } + + // Clean MinimalVersion.csv + File.WriteAllLines(Path.Combine(_rootDirectory, @"tools\VersionController", "MinimalVersion.csv"), new string[]{ header}); } + //Make Az.Accounts as the last module to calculate changedModules = changedModules.OrderByDescending(c => c == "Az.Accounts" ? "" : c).ToList(); foreach (var projectModuleManifestPath in changedModules)