diff options
Diffstat (limited to 'build.ps1')
| -rw-r--r-- | build.ps1 | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000..04966a1 --- /dev/null +++ b/build.ps1 @@ -0,0 +1,36 @@ +# 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 +}
\ No newline at end of file |
