# Packages the extension into a ZIP for distribution. # Excludes: tests/, doc/, ollama-js/, tools/, build artifacts, .git # Requires only PowerShell (Compress-Archive). No Node.js. $ErrorActionPreference = 'Stop' $include = @( 'manifest.json', 'icons', 'src' ) $outDir = 'dist' $outZip = Join-Path $outDir 'ollama-translations.zip' if (-not (Test-Path $outDir)) { New-Item -ItemType Directory -Path $outDir | Out-Null } if (Test-Path $outZip) { Remove-Item $outZip -Force } # Stage files in a temp folder so the zip has a clean root. $stage = Join-Path ([System.IO.Path]::GetTempPath()) ("ollama-translations-" + [System.Guid]::NewGuid().ToString('N')) New-Item -ItemType Directory -Path $stage | Out-Null try { foreach ($item in $include) { Copy-Item -Recurse -Force $item (Join-Path $stage $item) } Compress-Archive -Path (Join-Path $stage '*') -DestinationPath $outZip Write-Host "Created $outZip" } finally { Remove-Item -Recurse -Force $stage }