This is an automated email from the ASF dual-hosted git repository.
nightowl888 pushed a commit to branch fix/apidocs-automation
in repository https://gitbox.apache.org/repos/asf/lucenenet.git
The following commit(s) were added to refs/heads/fix/apidocs-automation by this
push:
new bb15190d2 docs.ps1: Add local install directory to the path
bb15190d2 is described below
commit bb15190d20f381abe26c7f6a496e14e3277273e7
Author: Shad Storhaug <[email protected]>
AuthorDate: Thu Oct 24 09:29:43 2024 +0700
docs.ps1: Add local install directory to the path
---
websites/apidocs/docs.ps1 | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/websites/apidocs/docs.ps1 b/websites/apidocs/docs.ps1
index 792e55b58..a1519f4b8 100644
--- a/websites/apidocs/docs.ps1
+++ b/websites/apidocs/docs.ps1
@@ -66,23 +66,28 @@ $BreadcrumbPath = Join-Path -Path $ApiDocsFolder -ChildPath
"docfx.global.subsit
$InstallDir = "$RepoRoot/.dotnet/tools"
# install docfx tool
-Write-Host "Restoring docfx tool..."
$PreviousLocation = Get-Location
Set-Location $RepoRoot
# Ensure docfx is installed
if (-not (Test-Path "$InstallDir/docfx")) {
- Write-Host "DocFX is not installed. Installing as a local tool..."
+ Write-Host "docfx is not installed. Installing as a local tool..."
# Install docfx as a local tool if it isn't listed in dotnet-tools.json
dotnet tool install --local docfx
} else {
- Write-Host "DocFX is already installed. Restoring tools..."
+ Write-Host "docfx is already installed. Restoring tools..."
# Restore local tools listed in dotnet-tools.json
dotnet tool restore
}
+# Add the local tool's path to the environment
+$env:PATH = "$InstallDir;$env:PATH"
+
+# Verify that docfx is accessible
+docfx --version
+
Set-Location $PreviousLocation
&dotnet tool list --local