forked from retrixe/octyne
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-with-webui.ps1
More file actions
41 lines (33 loc) · 903 Bytes
/
build-with-webui.ps1
File metadata and controls
41 lines (33 loc) · 903 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
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env pwsh
# Exit on any error
$ErrorActionPreference = "Stop"
$PSNativeCommandUseErrorActionPreference = $true
$CONFIG_FILE = "./ecthelion/config.json"
$BACKUP_FILE = "./ecthelion/config.backup.json"
# Backup config file if it exists
if (Test-Path $CONFIG_FILE) {
Write-Host "Backing up existing config file..."
Copy-Item $CONFIG_FILE $BACKUP_FILE
}
# Write new config contents
$configContent = @"
{
"ip": "http://localhost:42069/api",
"enableCookieAuth": true
}
"@
$configContent | Out-File -FilePath $CONFIG_FILE -Encoding UTF8
# Build Ecthelion
Set-Location ./ecthelion
corepack yarn
corepack yarn export
Set-Location ..
# Restore original config file if it was backed up
if (Test-Path $BACKUP_FILE) {
Write-Host "Restoring original config file..."
Move-Item $BACKUP_FILE $CONFIG_FILE -Force
} else {
Remove-Item $CONFIG_FILE
}
# Build Octyne
go build @args