-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocs_clean.ps1
More file actions
43 lines (35 loc) · 1.25 KB
/
docs_clean.ps1
File metadata and controls
43 lines (35 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<#
.SCRIPTNAME
docs_clean.ps1
.SYNOPSIS
Cleans the local ./docs folder before regenerating documentation.
.DESCRIPTION
This script safely removes the ./docs directory
to ensure that newly generated documentation does not mix with
old or obsolete files.
.NOTES
- Intended for use as part of the civic-dev Zig build process.
- Safe to run multiple times.
.EXAMPLE
./clean_docs.ps1
#>
$docsPath = Join-Path -Path (Get-Location) -ChildPath "docs"
$zigDocsPath = Join-Path -Path (Get-Location) -ChildPath "zig-out/docs"
if (Test-Path $docsPath) {
Write-Host "Removing existing ./docs folder..."
Remove-Item -Path $docsPath -Recurse -Force
} else {
Write-Host "No existing ./docs folder to remove."
}
Write-Host "Copying from $zigDocsPath to $docsPath... "
if (Test-Path $zigDocsPath) {
# Create the destination directory if it doesn't exist
if (-not (Test-Path $docsPath)) {
New-Item -ItemType Directory -Path $docsPath | Out-Null
}
# Copy all contents recursively
Copy-Item -Path "$zigDocsPath\*" -Destination $docsPath -Recurse -Force
Write-Host "Documentation copied successfully."
} else {
Write-Warning "WARNING: Documentation source path '$zigDocsPath' not found. Skipping docs copy."
}