Skip to content

Commit 35ad11b

Browse files
committed
Install script
1 parent c8e5595 commit 35ad11b

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

build_release.ps1

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ function Log {
1313

1414
function Run {
1515
param(
16+
[Parameter(Mandatory = $true, Position = 0)]
1617
[string]$Exe,
17-
[string[]]$Args
18+
[Parameter(ValueFromRemainingArguments = $true)]
19+
[string[]]$CmdArgs
1820
)
19-
Write-Host "+ $Exe $($Args -join ' ')"
20-
& $Exe @Args
21+
Write-Host "+ $Exe $($CmdArgs -join ' ')"
22+
& $Exe @CmdArgs
2123
if ($LASTEXITCODE -ne 0) {
22-
throw "Command failed with exit code ${LASTEXITCODE}: $Exe $($Args -join ' ')"
24+
throw "Command failed with exit code ${LASTEXITCODE}: $Exe $($CmdArgs -join ' ')"
2325
}
2426
}
2527

@@ -31,15 +33,15 @@ if (-not (Test-Path -Path $SpecFile -PathType Leaf)) {
3133
}
3234

3335
Log "Installing/upgrading PyInstaller tooling"
34-
Run $PythonBin @("-m", "pip", "install", "--upgrade", "pip", "pyinstaller")
36+
Run $PythonBin "-m" "pip" "install" "--upgrade" "pip" "pyinstaller"
3537

3638
Log "Building standalone executable with PyInstaller"
3739
Push-Location $RootDir
3840
try {
3941
$oldNoUserSite = $env:PYTHONNOUSERSITE
4042
$env:PYTHONNOUSERSITE = "1"
4143
try {
42-
Run $PythonBin @("-m", "PyInstaller", "--clean", "--noconfirm", "SerialUI.spec")
44+
Run $PythonBin "-m" "PyInstaller" "--clean" "--noconfirm" "SerialUI.spec"
4345
}
4446
finally {
4547
if ($null -eq $oldNoUserSite) {

0 commit comments

Comments
 (0)