Skip to content

Commit 458d4b6

Browse files
azure-powershell-botazurepowershell
andauthored
Sync tools folder from main branch to generation branch (#23795)
Co-authored-by: azurepowershell <[email protected]>
1 parent dffa75c commit 458d4b6

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

tools/RunVersionController.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,11 +397,11 @@ function Update-AzPreviewChangelog
397397

398398
function Update-AzSyntaxChangelog
399399
{
400-
Write-Host "starting revise SyntaxChangelog"
400+
Write-Host "starting revise SyntaxChangeLog"
401401
$rootPath = "$PSScriptRoot\.."
402402
$NewVersion = (Import-PowerShellDataFile "$PSScriptRoot\Az\Az.psd1").ModuleVersion
403-
Update-ChangeLog -Content "## $NewVersion - $Release" -FilePath "$rootPath\documentation\SyntaxChangelog.md"
404-
$changeLog = Get-Content "$rootPath\documentation\SyntaxChangelog.md" -Raw
403+
Update-ChangeLog -Content "## $NewVersion - $Release" -FilePath "$rootPath\documentation\SyntaxChangeLog.md"
404+
$changeLog = Get-Content "$rootPath\documentation\SyntaxChangeLog.md" -Raw
405405
$regex = '####\s+(Az\.\w+)\s+(?![\d\.])'
406406
$matches = Select-String -Pattern $regex -InputObject $changelog -AllMatches
407407
foreach ($match in $matches.Matches) {
@@ -411,7 +411,7 @@ function Update-AzSyntaxChangelog
411411
$replacement = "#### $moduleName $newVersion `r`n"
412412
$changelog = $changelog -replace [regex]::Escape($match.Value), $replacement
413413
}
414-
Set-Content -Path "$rootPath\documentation\SyntaxChangelog.md" -Value $changelog
414+
Set-Content -Path "$rootPath\documentation\SyntaxChangeLog.md" -Value $changelog
415415
}
416416

417417
function New-CommandMappingFile

tools/VersionController/Models/SyntaxChangelogGenerator.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ public class SyntaxChangelogGenerator
2424
"ProxyCredential", "ProxyUseDefaultCredentials", "Verbose", "WarningAction", "WarningVariable"
2525
};
2626
private List<CmdletDiffInformation> diffInfo = new List<CmdletDiffInformation>();
27-
public void Analyze(String srcDirs)
27+
public void Analyze(String rootDirectory)
2828
{
29-
var savedDirectory = Directory.GetCurrentDirectory();
29+
var srcDirs = Path.Combine(rootDirectory, @"src\");
3030
var manifestFiles = Directory.EnumerateFiles(srcDirs, "*.psd1", SearchOption.AllDirectories)
3131
.Where(file =>
3232
!Path.GetDirectoryName(file)
@@ -48,8 +48,7 @@ public void Analyze(String srcDirs)
4848
CmdletLoader.ModuleMetadata = newModuleMetadata;
4949
CompareModuleMetedata(oldModuleMetadata, newModuleMetadata, moduleName);
5050
}
51-
Directory.SetCurrentDirectory(savedDirectory);
52-
var markDownPath = Path.Combine(savedDirectory, "documentation/SyntaxChangelog.md");
51+
var markDownPath = Path.Combine(rootDirectory, "documentation/SyntaxChangeLog.md");
5352
GenerateMarkdown(markDownPath);
5453
Console.WriteLine("Cmdlets Differences written to {0}", markDownPath);
5554
}
@@ -407,7 +406,7 @@ public void GenerateMarkdown(string filePath)
407406
}
408407
if (GetDescription(diffInfo[i]) != "")
409408
{
410-
sb.Append("\n * " + GetDescription(diffInfo[i]));
409+
sb.Append("\n - " + GetDescription(diffInfo[i]));
411410
if (i < diffInfo.Count - 1 && diffInfo[i + 1].CmdletName != diffInfo[i].CmdletName)
412411
{
413412
sb.Append("\n");

tools/VersionController/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static void Main(string[] args)
7676

7777
ConsolidateExceptionFiles(exceptionsDirectory);
7878
ValidateManifest();
79-
GenerateSyntaxChangelog(Path.Combine(_rootDirectory, @"src\"));
79+
GenerateSyntaxChangelog(_rootDirectory);
8080
BumpVersions();
8181
}
8282
private static void GenerateSyntaxChangelog(string _projectDirectories)

0 commit comments

Comments
 (0)