-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsetup-env.ps1
More file actions
33 lines (27 loc) · 1.02 KB
/
Copy pathsetup-env.ps1
File metadata and controls
33 lines (27 loc) · 1.02 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
param(
[ValidateSet("dev", "prod")]
[string]$Mode = "dev",
[switch]$Force,
[switch]$WriteDockerEnv
)
$repoRoot = $PSScriptRoot
if (-not $repoRoot) {
$repoRoot = Get-Location
}
Write-Host "Setting up OpenSpell environment files (mode: $Mode)..." -ForegroundColor Green
Write-Host "Defaults target a single-player local setup (lowest security, minimal services)." -ForegroundColor Yellow
# Reference (root .env anti-cheat realtime):
# - ANTI_CHEAT_WEALTH_TRANSFER_WINDOW_MS=10000
# - ANTI_CHEAT_WEALTH_TRANSFER_VALUE_THRESHOLD=500000
# - ANTI_CHEAT_SHARED_IP_WINDOW_MS=30000
# - ANTI_CHEAT_SESSION_ALERT_START_HOURS=9
# - ANTI_CHEAT_SESSION_ALERT_STEP_HOURS=3
$scriptPath = Join-Path $repoRoot "scripts\setup-env.js"
if (-not (Test-Path $scriptPath)) {
Write-Host "Missing scripts\setup-env.js. Please run from repo root." -ForegroundColor Red
exit 1
}
$scriptArgs = @("--mode=$Mode")
if ($Force) { $scriptArgs += "--force" }
if ($WriteDockerEnv) { $scriptArgs += "--write-docker-env" }
node $scriptPath @scriptArgs