From 70c225bda302aa51f02e12bf2b70605dc4dca3ff Mon Sep 17 00:00:00 2001 From: Onyx and Iris Date: Wed, 15 Jan 2025 20:56:11 +0000 Subject: [PATCH] upd spec path --- build.ps1 | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/build.ps1 b/build.ps1 index ba6170a..d30235c 100644 --- a/build.ps1 +++ b/build.ps1 @@ -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 }