-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ps1
24 lines (18 loc) · 853 Bytes
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$ExtensionName = "fiddlerfox"
$BuildDirectory = Join-Path $PSScriptRoot "build"
$BuildPath = Join-Path $BuildDirectory $($ExtensionName + ".zip")
$ExtDirectory = Resolve-Path "src"
Write-Host "Building $ExtensionName"
function Create-ZipArchive {
param (
[string]$ZipName,
[string]$SourceDirectory
)
Add-Type -Assembly System.IO.Compression.FileSystem
$Compress = [System.IO.Compression.CompressionLevel]::Optimal
[System.IO.Compression.ZipFile]::CreateFromDirectory($SourceDirectory, $ZipName, $Compress, $false)
}
New-Item -ItemType Directory -Path $BuildDirectory -Force -ErrorAction SilentlyContinue | Out-Null
Remove-Item -Path $BuildPath -Force -ErrorAction SilentlyContinue
Create-ZipArchive -ZipName $BuildPath -SourceDirectory $ExtDirectory
Write-Host "ZIP file available at $BuildPath" -ForegroundColor Green