Skip to content

Commit eb6d672

Browse files
[eng] Remove changed modules from minimalVersion.csv only (#25992)
* Remove changed modules from minimalVersion.csv only * Update tools/VersionController/Program.cs --------- Co-authored-by: Jin Lei <[email protected]>
1 parent 3cba635 commit eb6d672

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tools/VersionController/Program.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,15 @@ private static void BumpVersions()
208208
var executingAssemblyPath = Assembly.GetExecutingAssembly().Location;
209209
var versionControllerDirectory = Directory.GetParent(executingAssemblyPath).FullName;
210210
var miniVersionFile = Path.Combine(versionControllerDirectory, "MinimalVersion.csv");
211+
var changedModuleNames = changedModules.Select(c => Path.GetFileName(c).Replace(".psd1", ""));
211212
if (File.Exists(miniVersionFile))
212213
{
213214
var file = File.ReadAllLines(miniVersionFile);
214215
var header = file.First();
215-
var lines = file.Skip(1).Where(c => !string.IsNullOrEmpty(c));
216+
var lines = file.Skip(1).Where(c => !string.IsNullOrWhiteSpace(c));
216217

217218
var bumpingModule = _moduleNameFilter.Replace(Psd1NameExtension, "");
218219
List<string> _minimalVersionContent = new List<string>() { header };
219-
220220
foreach (var line in lines)
221221
{
222222
var cols = line.Split(",").Select(c => c.StartsWith("\"") ? c.Substring(1) : c)
@@ -227,7 +227,8 @@ private static void BumpVersions()
227227
_minimalVersion.Add(cols[0], new AzurePSVersion(cols[1]));
228228

229229
// Bump one module, only remove its minimal version from MinimalVersion.csv content
230-
if (!string.IsNullOrEmpty(bumpingModule) && !cols[0].Equals(bumpingModule))
230+
if (!string.IsNullOrEmpty(bumpingModule) && !cols[0].Equals(bumpingModule) ||
231+
!changedModuleNames.Contains(cols[0]))
231232
{
232233
_minimalVersionContent.Add(line);
233234
}

0 commit comments

Comments
 (0)