21 lines
743 B
PowerShell
21 lines
743 B
PowerShell
param(
|
|
[string]$Version = "1.23.0",
|
|
[string]$PythonVersion = "3.10"
|
|
)
|
|
$ErrorActionPreference = "Stop"
|
|
$package = if ($Version) { "lizard==$Version" } else { "lizard" }
|
|
& py "-$PythonVersion" -m pip install --user --upgrade $package
|
|
if ($LASTEXITCODE -ne 0) {
|
|
exit $LASTEXITCODE
|
|
}
|
|
$python = & py "-$PythonVersion" -c "import sys; print(sys.executable)"
|
|
$scripts = Join-Path (Split-Path (Split-Path $python -Parent) -Parent) "Scripts"
|
|
$lizard = Join-Path $env:APPDATA "Python\Python$($PythonVersion.Replace('.', ''))\Scripts\lizard.exe"
|
|
if (!(Test-Path -LiteralPath $lizard)) {
|
|
$lizard = Join-Path $scripts "lizard.exe"
|
|
}
|
|
if (!(Test-Path -LiteralPath $lizard)) {
|
|
throw "lizard executable was not found"
|
|
}
|
|
& $lizard --version
|