Skip to content

Commit 9000215

Browse files
committed
Handle when component has no samples folder
1 parent bf45e14 commit 9000215

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Build-Toolkit-Docs.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,15 @@ $componentsRoot = Resolve-Path $PSScriptRoot/../components/
9393

9494
# For each component
9595
foreach ($componentFolder in Get-ChildItem -Path $componentsRoot -Directory) {
96+
# Add component to TOC
9697
$componentName = $componentFolder.Name
9798

98-
# Add component to TOC
99+
# Check if /samples folder exists
100+
if (-not (Test-Path "$componentFolder/samples")) {
101+
continue
102+
}
103+
104+
# Get markdown docs from samples folder
99105
$markdownFiles = Get-ChildItem -Recurse -Path "$componentFolder/samples/**/*.md" | Where-Object { $_.FullName -notlike "*\bin\*" -and $_FullName -notlike "*\obj\*" }
100106

101107
# If there's only one markdown file, append it to the root of the TOC

0 commit comments

Comments
 (0)