Start: Switch to Write-Host

Write-Output is equal to a return statement and breaks parts of
the script.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri
2023-12-25 11:59:58 -05:00
parent 670ccac19a
commit 5c08316d18

View File

@@ -9,13 +9,13 @@ param(
function GetRequirementsFile {
$GpuInfo = (Get-WmiObject Win32_VideoController).Name
if ($GpuInfo.Contains("AMD")) {
Write-Output "AMD/ROCm isn't supported on Windows. Please switch to linux."
Write-Error "AMD/ROCm isn't supported on Windows. Please switch to linux."
exit
}
# Install nowheel if specified
if ($nowheel) {
Write-Output "Not installing wheels due to user request."
Write-Host "Not installing wheels due to user request."
return "requirements-nowheel"
}
@@ -28,7 +28,7 @@ function GetRequirementsFile {
} elseif ($CudaVersion.Contains("11.8")) {
return "requirements-cu118"
} else {
Write-Output "Script cannot find your CUDA installation. installing from requirements-nowheel.txt"
Write-Host "Script cannot find your CUDA installation. installing from requirements-nowheel.txt"
return "requirements-nowheel"
}
}
@@ -37,21 +37,21 @@ function GetRequirementsFile {
function CreateAndActivateVenv {
# Is the user using conda?
if ($null -ne $env:CONDA_PREFIX) {
Write-Output "It looks like you're in a conda environment. Skipping venv check."
Write-Host "It looks like you're in a conda environment. Skipping venv check."
return
}
$VenvDir = "$PSScriptRoot\venv"
if (!(Test-Path -Path $VenvDir)) {
Write-Output "Venv doesn't exist! Creating one for you."
Write-Host "Venv doesn't exist! Creating one for you."
python -m venv venv
}
. "$VenvDir\Scripts\activate.ps1"
if ($activate_venv) {
Write-Output "Stopping at venv activation due to user request."
Write-Host "Stopping at venv activation due to user request."
exit
}
}
@@ -60,7 +60,7 @@ function CreateAndActivateVenv {
function StartAPI {
pip -V
if ($ignore_upgrade) {
Write-Output "Ignoring pip dependency upgrade due to user request."
Write-Host "Ignoring pip dependency upgrade due to user request."
} else {
pip install --upgrade -r "$RequirementsFile.txt"
}