From 90bde47692075da5fcfe791f09fa2357c8fb6995 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Thu, 31 Oct 2024 05:56:48 +0800 Subject: Find slangc in more places in doc generation script (#5461) Co-authored-by: Yong He --- docs/build_reference.ps1 | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'docs') diff --git a/docs/build_reference.ps1 b/docs/build_reference.ps1 index 726fa804c..a29676819 100644 --- a/docs/build_reference.ps1 +++ b/docs/build_reference.ps1 @@ -33,13 +33,23 @@ Remove-Item -Path ".\stdlib-reference\attributes" -Recurse -Force git describe --tags | Out-File -FilePath ".\stdlib-reference\_includes\version.inc" -Encoding ASCII cd stdlib-reference -& ../../build/Release/bin/slangc -compile-core-module -doc -Move-Item -Path ".\toc.html" -Destination ".\_includes\stdlib-reference-toc.html" -Force -git config user.email "bot@shader-slang.com" -git config user.name "Stdlib Reference Bot" -git add . -git commit -m "Update the core module reference" -git push +$slangPaths = @( + "../../build/RelWithDebInfo/bin/slangc.exe", + "../../build/Release/bin/slangc.exe", + "../../build/Debug/bin/slangc.exe" +) +$slangExe = $slangPaths | Where-Object { Test-Path $_ } | Select-Object -First 1 +if ($slangExe) { + & $slangExe -compile-core-module -doc + Move-Item -Path ".\toc.html" -Destination ".\_includes\stdlib-reference-toc.html" -Force + git config user.email "bot@shader-slang.com" + git config user.name "Stdlib Reference Bot" + git add . + git commit -m "Update the core module reference" + git push +} else { + Write-Error "Could not find slangc executable in RelWithDebInfo or Release directories" +} cd ../ # For local debugging only. -- cgit v1.2.3