douyinWEB/desktop/scripts/fetch-pocketbase.ps1
Eric 960a268fa2 Make desktop the sole Windows client with unmanned live and boot/poll hardening.
Consolidate Douyin→YouTube RTMPS into /live, parallel local service boot, poll-only realtime, slimmer packs/charts, and deprecate youtube-live-win.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-23 14:10:07 +01:00

29 lines
1.1 KiB
PowerShell

# Download PocketBase Windows x64 into repo pb/pocketbase.exe
$ErrorActionPreference = "Stop"
$RepoRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
$DestDir = Join-Path $RepoRoot "pb"
$DestExe = Join-Path $DestDir "pocketbase.exe"
$Ver = if ($env:PB_VER) { $env:PB_VER } else { "0.25.8" }
New-Item -ItemType Directory -Force -Path $DestDir | Out-Null
if (Test-Path $DestExe) {
Write-Host "OK (exists) -> $DestExe"
& $DestExe --version
exit 0
}
$Zip = Join-Path $env:TEMP "dy-desktop-pocketbase.zip"
$Url = "https://github.com/pocketbase/pocketbase/releases/download/v$Ver/pocketbase_${Ver}_windows_amd64.zip"
Write-Host "Downloading PocketBase $Ver ..."
Invoke-WebRequest -Uri $Url -OutFile $Zip -UseBasicParsing
$Extract = Join-Path $env:TEMP "dy-desktop-pocketbase-extract"
if (Test-Path $Extract) { Remove-Item -Recurse -Force $Extract }
Expand-Archive -Path $Zip -DestinationPath $Extract -Force
$Bin = Get-ChildItem -Path $Extract -Recurse -Filter "pocketbase.exe" | Select-Object -First 1
if (-not $Bin) { throw "pocketbase.exe not found in archive" }
Copy-Item $Bin.FullName $DestExe -Force
Write-Host "OK -> $DestExe"
& $DestExe --version