-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathBuildDocs.ps1
More file actions
29 lines (22 loc) · 932 Bytes
/
BuildDocs.ps1
File metadata and controls
29 lines (22 loc) · 932 Bytes
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
..\GMDoc\env\Scripts\activate
# Extract version from gmdoc.json
$VERSION = (Get-Content gmdoc.json | ConvertFrom-Json).version
python.exe ..\GMDoc\gmdoc.py build
# Create directory if it doesn't exist, then clean it
New-Item -ItemType Directory -Path C:\xampp\htdocs\bbmod\docs\$VERSION -Force | Out-Null
Remove-Item -Path C:\xampp\htdocs\bbmod\docs\$VERSION\* -Recurse -Force -ErrorAction SilentlyContinue
Copy-Item -Path .\docs_build\* -Destination C:\xampp\htdocs\bbmod\docs\$VERSION -Recurse
$DB_SOURCE = ".\docs_build\docs.sqlite"
$DB_DEST_DIR = "C:\xampp\htdocs\bbmod\data\docs"
$DB_DEST = "$DB_DEST_DIR\docs-v$VERSION.sqlite"
if (Test-Path $DB_SOURCE)
{
New-Item -ItemType Directory -Path $DB_DEST_DIR -Force | Out-Null
Copy-Item -Path $DB_SOURCE -Destination $DB_DEST -Force
Write-Host "Copied SQLite database to $DB_DEST"
}
else
{
Write-Warning "SQLite database not found at $DB_SOURCE"
}
deactivate