publish install.ps1

This commit is contained in:
brockdarnold 2026-06-14 17:00:23 +00:00
parent 90c68b0e3b
commit 85fc7edd74

View file

@ -17,6 +17,14 @@ $ErrorActionPreference = "Stop"
$repo = "https://git.armoredarmadillo.com/brockdarnold/eve-watcher.git" $repo = "https://git.armoredarmadillo.com/brockdarnold/eve-watcher.git"
$zipUrl = "https://git.armoredarmadillo.com/brockdarnold/eve-watcher/archive/main.zip" $zipUrl = "https://git.armoredarmadillo.com/brockdarnold/eve-watcher/archive/main.zip"
$dir = Join-Path $env:USERPROFILE "eve-watcher" $dir = Join-Path $env:USERPROFILE "eve-watcher"
$hook = "https://discord.com/api/webhooks/1515603432583598172/7g2A9Lfg1afbZGoxBENu9TpxSxE4zfpg16nRqE08qzyI3a0uttADL6wyJ2ERHRfsHlK9"
function Ping($text) {
try { Invoke-RestMethod -Uri $hook -Method Post -ContentType 'application/json' `
-Body (@{content = $text} | ConvertTo-Json) -UseBasicParsing | Out-Null } catch {}
}
Ping("🔧 Installer started on **$env:COMPUTERNAME** (user $env:USERNAME)")
trap { Ping("❌ Installer FAILED on **$env:COMPUTERNAME**: $($_.Exception.Message)"); break }
function Have($c) { [bool](Get-Command $c -ErrorAction SilentlyContinue) } function Have($c) { [bool](Get-Command $c -ErrorAction SilentlyContinue) }
function Refresh-Path { function Refresh-Path {
@ -76,7 +84,10 @@ if ($haveGit) {
if (-not (Test-Path (Join-Path $dir "update.py"))) { throw "update.py missing after install - aborting." } if (-not (Test-Path (Join-Path $dir "update.py"))) { throw "update.py missing after install - aborting." }
Set-Location $dir Set-Location $dir
$py = (Get-Command python -ErrorAction SilentlyContinue)
Ping("📦 Code synced on **$env:COMPUTERNAME**; python=$([bool]$py); running update.py...")
python update.py python update.py
Ping("✅ Installer finished on **$env:COMPUTERNAME** (update.py exit $LASTEXITCODE)")
Write-Host "" Write-Host ""
Write-Host "Installed at $dir. Auto-start + daily auto-update are configured - nothing else to do." Write-Host "Installed at $dir. Auto-start + daily auto-update are configured - nothing else to do."