upd spec path

This commit is contained in:
Onyx and Iris 2025-01-15 20:56:11 +00:00
parent f459cdee44
commit 70c225bda3

View File

@ -4,36 +4,37 @@ param(
[string]$theme
)
function Format-Path {
param($Kind)
function Format-SpecName {
param(
[string]$Kind
)
return @(
$prefix,
(& { if ($theme) { $theme } else { "" } }),
"${Kind}"
$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
$compressPath = Format-SpecName -Kind $_
Compress-Archive -Path (Join-Path -Path $target -ChildPath $compressPath) -DestinationPath (Join-Path -Path $target -ChildPath "${compressPath}.zip") -Force
}
}
function Get-Builds {
@("basic", "banana", "potato") | ForEach-Object {
$spec_path = Format-Path -Kind $_
$specName = Format-SpecName -Kind $_
"building $spec_path" | Write-Host
Write-Host "building $specName"
poetry run pyinstaller "$spec_path.spec" --noconfirm
}
poetry run pyinstaller --noconfirm --distpath (Join-Path -Path "dist" -ChildPath $specName) (Join-Path -Path "spec" -ChildPath "${specName}.spec")
}
}
function main {
Get-Builds
Compress-Builds
}