voicemeeter-compact/build.ps1

40 lines
974 B
PowerShell
Raw Normal View History

2023-08-27 02:41:07 +01:00
param(
[Parameter(Mandatory = $true)]
[string]$prefix,
[string]$theme
)
function Format-Path {
param($Kind)
return @(
$prefix,
(& { if ($theme) { $theme } else { "" } }),
"${Kind}"
).Where({ $_ -ne "" }) -Join "_"
}
function Compress-Builds {
$target = Join-Path -Path $PSScriptRoot -ChildPath "dist"
@("basic", "banana", "potato") | ForEach-Object {
$compress_path = Format-Path -Kind $_
Compress-Archive -Path $(Join-Path -Path $target -ChildPath $compress_path) -DestinationPath $(Join-Path -Path $target -ChildPath "${compress_path}.zip") -Force
}
}
function Get-Builds {
@("basic", "banana", "potato") | ForEach-Object {
$spec_path = Format-Path -Kind $_
"building $spec_path" | Write-Host
poetry run pyinstaller "$spec_path.spec" --noconfirm
}
}
function main {
Get-Builds
Compress-Builds
}
if ($MyInvocation.InvocationName -ne '.') { main }