From cc5a13dc782c25446ac02cce1434e0b05539ab42 Mon Sep 17 00:00:00 2001 From: IRBorisov <8611739+IRBorisov@users.noreply.github.com> Date: Fri, 12 Apr 2024 19:54:23 +0300 Subject: [PATCH] Fix build script --- scripts/Build.ps1 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/Build.ps1 b/scripts/Build.ps1 index f54a06e..e6548c2 100644 --- a/scripts/Build.ps1 +++ b/scripts/Build.ps1 @@ -1,7 +1,7 @@ Set-Location $PSScriptRoot\.. $packageName = 'cctext' -$output = 'dist' +$output = "${PSScriptRoot}\..\dist" $python = '.\venv\Scripts\python.exe' if (-not (Test-Path -Path ${python} -PathType Leaf)) { @@ -9,19 +9,19 @@ if (-not (Test-Path -Path ${python} -PathType Leaf)) { & ${python} -m pip install -r requirements-build.txt } -if (Test-Path -Path $output\$packageName) { - Remove-Item $output\$packageName -Recurse -Force +if (Test-Path -Path ${output}) { + Remove-Item ${output} -Recurse -Force } -& ${python} -m build --outdir=${output}\ -$wheel = Get-Childitem -Path ${output}\*.whl -Name +& ${python} -m build --outdir="${output}\" +$wheel = Get-Childitem -Path "${output}\*.whl" -Name if (-not ${wheel}) { Write-Error "No wheel generated for ${packageName}" Exit 1 } -& ${python} -m pip install -I ${output}\${wheel} +& ${python} -m pip install -I "${output}\${wheel}" & ${python} -m unittest $exitcode = $LASTEXITCODE -& ${python} -m pip uninstall -y $packageName -Exit $exitcode \ No newline at end of file +& ${python} -m pip uninstall -y ${packageName} +Exit ${exitcode} \ No newline at end of file