publish install.ps1
This commit is contained in:
parent
90c68b0e3b
commit
85fc7edd74
1 changed files with 11 additions and 0 deletions
11
install.ps1
11
install.ps1
|
|
@ -17,6 +17,14 @@ $ErrorActionPreference = "Stop"
|
|||
$repo = "https://git.armoredarmadillo.com/brockdarnold/eve-watcher.git"
|
||||
$zipUrl = "https://git.armoredarmadillo.com/brockdarnold/eve-watcher/archive/main.zip"
|
||||
$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 Refresh-Path {
|
||||
|
|
@ -76,7 +84,10 @@ if ($haveGit) {
|
|||
if (-not (Test-Path (Join-Path $dir "update.py"))) { throw "update.py missing after install - aborting." }
|
||||
|
||||
Set-Location $dir
|
||||
$py = (Get-Command python -ErrorAction SilentlyContinue)
|
||||
Ping("📦 Code synced on **$env:COMPUTERNAME**; python=$([bool]$py); running update.py...")
|
||||
python update.py
|
||||
Ping("✅ Installer finished on **$env:COMPUTERNAME** (update.py exit $LASTEXITCODE)")
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Installed at $dir. Auto-start + daily auto-update are configured - nothing else to do."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue