Skip to content

Commit

Permalink
docs.ps1: Restore to original
Browse files Browse the repository at this point in the history
  • Loading branch information
NightOwl888 committed Oct 24, 2024
1 parent 697bb2f commit 1c68395
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions websites/apidocs/docs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,13 @@ $TocPath1 = Join-Path -Path $ApiDocsFolder -ChildPath "toc.yml"
$TocPath2 = Join-Path -Path $ApiDocsFolder -ChildPath "toc\toc.yml"
$BreadcrumbPath = Join-Path -Path $ApiDocsFolder -ChildPath "docfx.global.subsite.json"

# The default local tools directory
$InstallDir = "$RepoRoot/.dotnet/tools"
$DocFxVersion = "2.77.0"
$VersionedInstallDir = "$InstallDir/docfx/$DocFxVersion"

# install docfx tool
Write-Host "Restoring docfx tool..."
$PreviousLocation = Get-Location
Set-Location $RepoRoot


# Ensure docfx is installed
if (-not (Test-Path "$VersionedInstallDir")) {
Write-Host "docfx $DocFxVersion 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 --tool-path "$VersionedInstallDir"
}
dotnet tool restore
Set-Location $PreviousLocation

& dotnet tool list --local
# Verify that docfx is accessible
& "$VersionedInstallDir/docfx" --version

# delete anything that already exists
if ($Clean) {
Write-Host "Cleaning..."
Expand Down

0 comments on commit 1c68395

Please sign in to comment.