File: D:/web/hyperflight/apps/inxpress/Save-Flags.ps1
# Create flags folder
$flags = @(
'gb','uk','ie','fr','de','es','it','nl','be','dk','se','no','fi','at','ch','pl','pt','cz','sk','hu','ro','bg','ee','lv','lt',
'us','ca','mx',
'au','nz',
'jp','kr','cn','hk','sg','ae','in','pk','tr','za'
)
$dest = "app\static\flags"
New-Item -ItemType Directory -Force -Path $dest | Out-Null
# Download SVGs from FlagCDN (free, tiny, reliable)
foreach ($cc in $flags) {
$url = "https://flagcdn.com/$cc.svg"
$file = Join-Path $dest "$cc.svg"
try {
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing -ErrorAction Stop
Write-Host "Saved $file"
} catch {
Write-Warning "Failed $cc : $($_.Exception.Message)"
}
}
# Also add a simple globe.svg fallback
$globe = @"
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 18">
<rect width="24" height="18" fill="#e6f0ff"/>
<circle cx="12" cy="9" r="7" fill="#66a3ff" stroke="#1f5fbf" stroke-width="1"/>
<path d="M5 9h14M12 2a18 18 0 0 0 0 14M12 2a18 18 0 0 1 0 14" stroke="#1f5fbf" stroke-width="0.8" fill="none"/>
</svg>
"@
Set-Content -Path (Join-Path $dest "globe.svg") -Value $globe -Encoding UTF8
Write-Host "Added globe.svg"