File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,18 @@ function GetReadme{
5252
5353 $readmeFilePath = Join-Path - Path $SamplePath - ChildPath " README.md"
5454
55+ # On case-sensitive file systems (e.g. Linux), try a case-insensitive fallback
56+ # if the exact path does not exist (e.g. readme.md instead of README.md)
57+ if (-not (Test-Path - Path $readmeFilePath )){
58+ $readmeFile = Get-ChildItem - Path $SamplePath | Where-Object { $_.Name -ieq " README.md" } | Select-Object - First 1
59+ if ($readmeFile ){
60+ $readmeFilePath = $readmeFile.FullName
61+ }else {
62+ Write-Host " Warning: README not found in $SamplePath "
63+ return $null
64+ }
65+ }
66+
5567 $content = Get-Content $readmeFilePath - Raw
5668
5769 return $content
@@ -122,6 +134,12 @@ $files | Foreach-Object {
122134 }
123135
124136 $content = GetReadme - SamplePath $_.Directory
137+
138+ if ($null -eq $content ){
139+ Write-Host " Warning: Skipping $ ( $_.Directory.Name ) - README.md could not be loaded"
140+ return
141+ }
142+
125143 $title = GetTitleFromSampleJson - SamplePath $_.Directory - DefaultReturn $_.Directory.Name
126144 $dirName = $_.Directory.Name
127145 $cmdletsUsed = " "
You can’t perform that action at this time.
0 commit comments