From 46da74bf4a09f8d50c494a041773f0548d0137ed Mon Sep 17 00:00:00 2001 From: chrischristiansen-glitch Date: Fri, 22 May 2026 02:09:40 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20add=20osv-startup.ps1=20=E2=80=94=20VS?= =?UTF-8?q?=20Code=20Windows=20startup=20script=20with=20OPAX=20banner,=20?= =?UTF-8?q?git=20pull=20and=20OPAX=20ping=20[Phase=204]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/osv-startup.ps1 | 84 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 scripts/osv-startup.ps1 diff --git a/scripts/osv-startup.ps1 b/scripts/osv-startup.ps1 new file mode 100644 index 0000000..88e5ba0 --- /dev/null +++ b/scripts/osv-startup.ps1 @@ -0,0 +1,84 @@ +# OSVauco · OPAX — VS Code Windows Startup Script +# Kjøres automatisk via terminal.integrated.profiles.windows i VS Code +# Tilsvarer osvauco-opax-boot.sh men for PowerShell/Windows + +$REPO_PATH = "G:\Shared drives\OS-VAUCO-DRIVE\OSVauco" +$PING_URL = "https://opax.vauco.no/ping" +$LOG_FILE = "$REPO_PATH\docs\OSVAUCO_OPAX_SESSION_LOG.md" + +Set-Location $REPO_PATH + +Clear-Host + +Write-Host "============================================================" -ForegroundColor Cyan +Write-Host " O S V A U C O · O P A X" -ForegroundColor Cyan +Write-Host "============================================================" -ForegroundColor Cyan +Write-Host " VS Code · Windows · PowerShell" -ForegroundColor DarkCyan +Write-Host "" +Write-Host " Repo : OSVauco (main)" -ForegroundColor Gray +Write-Host " HUB_URL : $PING_URL" -ForegroundColor Gray +Write-Host " Session : $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')" -ForegroundColor Gray +Write-Host "" + +# --- NESTE OPPGAVE fra session log --- +if (Test-Path $LOG_FILE) { + $logContent = Get-Content $LOG_FILE -Raw + $match = [regex]::Match($logContent, '(?s)## NESTE OPPGAVE\r?\n(.*?)(?=\r?\n## |$)') + if ($match.Success) { + Write-Host " ▶ NESTE OPPGAVE:" -ForegroundColor Green + $match.Groups[1].Value.Trim() -split "`n" | ForEach-Object { + Write-Host " $_" -ForegroundColor Green + } + Write-Host "" + } else { + Write-Host " ⚠ Ingen NESTE OPPGAVE funnet — sjekk docs/VAUCO_OS_ROADMAP.md" -ForegroundColor Yellow + Write-Host "" + } +} else { + Write-Host " ⚠ Session log ikke funnet" -ForegroundColor Yellow + Write-Host "" +} + +# --- Git pull --- +Write-Host " › Git pull..." -NoNewline -ForegroundColor Blue +try { + $gitOut = git pull 2>&1 + if ($LASTEXITCODE -eq 0) { + Write-Host " [OK]" -ForegroundColor Green + if ($gitOut -match 'Already up to date') { + Write-Host " Already up to date" -ForegroundColor DarkGray + } else { + $gitOut | Where-Object { $_ -match 'files? changed' } | ForEach-Object { + Write-Host " $_" -ForegroundColor Cyan + } + } + } else { + Write-Host " [FAIL]" -ForegroundColor Red + } +} catch { + Write-Host " [FAIL] $_" -ForegroundColor Red +} + +Write-Host "" + +# --- OPAX ping --- +Write-Host " › Tester OPAX-MCP: $PING_URL" -NoNewline -ForegroundColor Blue +try { + $response = Invoke-RestMethod -Uri $PING_URL -TimeoutSec 5 + if ($response.status -eq 'ok') { + Write-Host " [OK]" -ForegroundColor Green + Write-Host " ✅ OPAX-MCP: OK — https://opax.vauco.no" -ForegroundColor Green + } else { + Write-Host " [WARN]" -ForegroundColor Yellow + Write-Host " ⚠ Uventet svar: $response" -ForegroundColor Yellow + } +} catch { + Write-Host " [FAIL]" -ForegroundColor Red + Write-Host " ❌ OPAX-MCP nede — sjekk Cloud Run / DNS" -ForegroundColor Red +} + +Write-Host "" +Write-Host "============================================================" -ForegroundColor Cyan +Write-Host " ▶ OSVAUCO/OPAX READY" -ForegroundColor Green +Write-Host "============================================================" -ForegroundColor Cyan +Write-Host ""