Skip to content

Commit 0b67829

Browse files
🩹 [Patch]: Refactor variable names for clarity in Build-PSModuleDocumentation
1 parent 0a86bdb commit 0b67829

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

‎scripts/helpers/Build-PSModuleDocumentation.ps1‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,20 @@
7373
}
7474
}
7575

76-
$docsOutputFolder = Join-Path $docsOutputFolder $ModuleName | Get-Item
76+
$moduleDocsFolder = Join-Path $docsOutputFolder $ModuleName | Get-Item
7777

7878
Write-Host '::group::Build docs - Generated files'
79-
Get-ChildItem -Path $docsOutputFolder -Recurse | Select-Object -ExpandProperty FullName
79+
Get-ChildItem -Path $moduleDocsFolder -Recurse | Select-Object -ExpandProperty FullName
8080
Write-Host '::endgroup::'
8181

82-
Get-ChildItem -Path $DocsOutputFolder -Recurse -Force -Include '*.md' | ForEach-Object {
82+
Get-ChildItem -Path $moduleDocsFolder -Recurse -Force -Include '*.md' | ForEach-Object {
8383
$fileName = $_.Name
8484
Write-Host "::group:: - [$fileName]"
8585
Show-FileContent -Path $_
8686
}
8787

8888
Write-Host '::group::Build docs - Fix markdown code blocks'
89-
Get-ChildItem -Path $DocsOutputFolder -Recurse -Force -Include '*.md' | ForEach-Object {
89+
Get-ChildItem -Path $moduleDocsFolder -Recurse -Force -Include '*.md' | ForEach-Object {
9090
$content = Get-Content -Path $_.FullName
9191
$fixedOpening = $false
9292
$newContent = @()
@@ -105,7 +105,7 @@
105105
}
106106

107107
Write-Host '::group::Build docs - Fix markdown escape characters'
108-
Get-ChildItem -Path $DocsOutputFolder -Recurse -Force -Include '*.md' | ForEach-Object {
108+
Get-ChildItem -Path $moduleDocsFolder -Recurse -Force -Include '*.md' | ForEach-Object {
109109
$content = Get-Content -Path $_.FullName -Raw
110110
$content = $content -replace '\\`', '`'
111111
$content = $content -replace '\\\[', '['
@@ -118,7 +118,6 @@
118118

119119
Write-Host '::group::Build docs - Structure markdown files to match source files'
120120
$PublicFunctionsFolder = Join-Path $ModuleSourceFolder.FullName 'functions\public' | Get-Item
121-
$moduleDocsFolder = Join-Path $DocsOutputFolder.FullName $ModuleName
122121
Get-ChildItem -Path $moduleDocsFolder -Recurse -Force -Include '*.md' | ForEach-Object {
123122
$file = $_
124123
$relPath = [System.IO.Path]::GetRelativePath($moduleDocsFolder, $file.FullName)
@@ -144,7 +143,6 @@
144143
}
145144

146145
Write-Host '::group::Build docs - Move markdown files from source files to docs'
147-
$moduleDocsFolder = Join-Path $DocsOutputFolder.FullName $ModuleName
148146
Get-ChildItem -Path $PublicFunctionsFolder -Recurse -Force -Include '*.md' | ForEach-Object {
149147
$file = $_
150148
$relPath = [System.IO.Path]::GetRelativePath($PublicFunctionsFolder.FullName, $file.FullName)
@@ -159,7 +157,7 @@
159157
}
160158

161159
Write-Host '────────────────────────────────────────────────────────────────────────────────'
162-
Get-ChildItem -Path $DocsOutputFolder -Recurse -Force -Include '*.md' | ForEach-Object {
160+
Get-ChildItem -Path $moduleDocsFolder -Recurse -Force -Include '*.md' | ForEach-Object {
163161
$fileName = $_.Name
164162
Write-Host "::group:: - [$fileName]"
165163
Show-FileContent -Path $_

0 commit comments

Comments
 (0)