Skip to content

Commit 69ef6f2

Browse files
authored
Update gen2master caused by readme.md renamed to README.md (#16166)
* Update gen2master caused by readme.md renamed to README.md We should be able to handle both cases since there will be some legacy code still using readme.md. * Fix a typo
1 parent 24c79d0 commit 69ef6f2

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

tools/Gen2Master/MoveFromGeneration2Master.ps1

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Function Move-Generation2Master {
7070
Write-Host "Copying docs: $SourceItem." -ForegroundColor Yellow
7171
Copy-Item -Recurse -Path $SourceItem -Destination $DestItem
7272
#EndRegion
73-
$File2Copy = @('*.ps1', 'how-to.md', 'readme.md', '*.psm1', '*.ps1xml')
73+
$File2Copy = @('*.ps1', 'how-to.md', 'readme.md', 'README.md', '*.psm1', '*.ps1xml')
7474
Foreach($File in $File2Copy) {
7575
$SourceItem = Join-Path -Path $SourcePath -ChildPath $File
7676
$DestItem = Join-Path -Path $DestPath -ChildPath $File
@@ -118,20 +118,13 @@ Function Move-Generation2Master {
118118
#EndRegion
119119

120120
#Region Remove unnecessary readme.md
121-
$ReadmeInHelp = Join-Path -Path (Join-Path -Path $DestPath -ChildPath 'help') -ChildPath 'readme.md'
122121
$ModuleReadmeInHelp = Join-Path -Path (Join-Path -Path $DestPath -ChildPath 'help') -ChildPath "Az.$ModuleName.md"
123-
If (Test-Path $ReadmeInHelp) {
124-
Write-Host "Deleting file $ReadmeInHelp." -ForegroundColor Yellow
125-
Remove-Item -Path $ReadmeInHelp
126-
}
122+
Get-ChildItem -Path (Join-Path -Path $DestPath -ChildPath 'help') -Recurse -Include 'readme.md' | Remove-Item -ErrorAction SilentlyContinue
127123
If ($Null -ne $ModuleGuid) {
128124
$ReadmeContent = Get-Content -Path $ModuleReadmeInHelp
129125
$ReadmeContent -replace "Module Guid: [0-9a-z\-]+","Module Guid: $ModuleGuid" | Set-Content -Path $ModuleReadmeInHelp
130126
}
131-
$ReadmeInExample = Join-Path -Path (Join-Path -Path $DestPath -ChildPath 'examples') -ChildPath 'readme.md'
132-
If (Test-Path $ReadmeInExample) {
133-
Remove-Item -Path $ReadmeInExample
134-
}
127+
Get-ChildItem -Path (Join-Path -Path $DestPath -ChildPath 'examples') -Recurse -Include 'readme.md' | Remove-Item -ErrorAction SilentlyContinue
135128
#EndRegion
136129

137130
#Region generate-info.json Here have a issue that user may not use latest version to generate the code.

0 commit comments

Comments
 (0)