-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathRun.ps1
36 lines (28 loc) · 824 Bytes
/
Run.ps1
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
param(
[switch] $NoBuild,
[switch] $NoInstall,
[switch] $Debug,
[switch] $Devmode,
[switch] $DeleteSave
)
$ErrorActionPreference = "Stop"
Write-Host ""
if (!$NoInstall) {
npm ci
} else {
Write-Warning "Make sure to run 'npm ci' before running this script"
}
if (!$NoBuild) {
npm run build
} else {
Write-Warning "Make sure to run 'npm run build' before running this script"
}
$SaveFile = Join-Path $PSScriptRoot "savefile.json"
if ($DeleteSave -and (Test-Path $SaveFile)) {
Write-Warning "Deleting old save file: $SaveFile"
Remove-Item -Path $SaveFile -Force | Out-Null
}
$ENV:NECRO_SAVEFILE = $SaveFile
$ENV:NECRO_DEBUG = if ($Debug) { "true" } else { "false" }
$ENV:NECRO_DEVMODE = if ($Devmode) { "true" } else { "false" }
npm start