@@ -9,8 +9,51 @@ $runLocation = Get-Location
99# .\report-age.ps1 -BaseDir "$($runLocation)\..\" -ReportFile "age.md"
1010
1111Write-Host " Generating samples.json..." - ForegroundColor Cyan
12- .\generate- samplesJson.ps1 - BaseDir " $ ( $runLocation ) \..\" - ReportFile " samples.json"
12+ $baseDir = (Resolve-Path (Join-Path $runLocation " .." )).Path
13+ ./ generate- samplesJson.ps1 - BaseDir $baseDir - ReportFile " samples.json"
1314
1415# Main DocFX build
1516Write-Host " Building docfx..." - ForegroundColor Cyan
16- docfx build docfx.json -- warningsAsErrors $args
17+ if ($IsMacOs ){
18+
19+ <#
20+ Download DocFx and Install Mono if not already done.
21+
22+ - https://github.com/dotnet/docfx/releases/tag/v2.56.7
23+ - https://www.mono-project.com/docs/getting-started/install/mac/
24+
25+ Setup DocFx alias for MacOS
26+
27+ 1. In VS Code, create a new file (e.g., `docfx.sh`) to hold the wrapper script.
28+ 2. Add a wrapper to your script:
29+
30+ ```bash
31+ #!/bin/zsh
32+ mono /path/to/docfx.exe "$@"
33+ ```
34+ Replace `/path/to/docfx.exe` with the actual path.
35+ 3. Make it executable in your terminal: `chmod +x /path/to/docfx.sh`.
36+ 4. Move it to your PATH (e.g., `sudo mv /path/to/docfx.sh /usr/local/bin/docfx`).
37+ 5. Restart the VS Code integrated terminal so `docfx` is available as an alias-like command without hardcoding paths in your scripts.
38+
39+ #>
40+
41+ Write-Host " Running docfx on MacOS using mono..." - ForegroundColor Cyan
42+ bash docfx build docfx.json -- warningsAsErrors $args
43+
44+ }else {
45+
46+ <#
47+ Download DocFx and Install Mono if not already done.
48+
49+ - https://github.com/dotnet/docfx/releases/tag/v2.56.7
50+ - Set the PATH environment variable to include the path to docfx.exe
51+ - Open System Properties > Advanced > Environment Variables
52+ - Under System Variables, find and select the 'Path' variable, then click 'Edit'
53+ - Click 'New' and add the full path to the directory containing 'docfx.exe'
54+ - Click 'OK' to save the changes
55+ #>
56+
57+ Write-Host " Running docfx on Windows..." - ForegroundColor Cyan
58+ docfx build docfx.json -- warningsAsErrors $args
59+ }
0 commit comments