Skip to content

Commit

Permalink
Start: Switch to Write-Host
Browse files Browse the repository at this point in the history
Write-Output is equal to a return statement and breaks parts of
the script.

Signed-off-by: kingbri <[email protected]>
  • Loading branch information
bdashore3 committed Dec 25, 2023
1 parent 670ccac commit 5c08316
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions start.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand All @@ -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"
}
}
Expand All @@ -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
}
}
Expand All @@ -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"
}
Expand Down

0 comments on commit 5c08316

Please sign in to comment.