From b126e2acca8790a35ebe8275494c08b8be95f698 Mon Sep 17 00:00:00 2001 From: Tess Gauthier Date: Thu, 8 Feb 2024 15:09:41 -0500 Subject: [PATCH] remove print statements when clippy is specified --- build.ps1 | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/build.ps1 b/build.ps1 index 8313b335..4d0a6193 100644 --- a/build.ps1 +++ b/build.ps1 @@ -196,33 +196,35 @@ if ($failed) { Copy-Item $PSScriptRoot/tools/add-path.ps1 $target -Force -ErrorAction Ignore $relative = Resolve-Path $target -Relative -Write-Host -ForegroundColor Green "`nEXE's are copied to $target ($relative)" +if (!$Clippy) { + Write-Host -ForegroundColor Green "`nEXE's are copied to $target ($relative)" -# remove the other target in case switching between them -$dirSeparator = [System.IO.Path]::DirectorySeparatorChar -if ($Release) { - $oldTarget = $target.Replace($dirSeparator + 'release', $dirSeparator + 'debug') -} -else { - $oldTarget = $target.Replace($dirSeparator + 'debug', $dirSeparator + 'release') -} -$env:PATH = $env:PATH.Replace($oldTarget, '') - -$paths = $env:PATH.Split([System.IO.Path]::PathSeparator) -$found = $false -foreach ($path in $paths) { - if ($path -eq $target) { - $found = $true - break + # remove the other target in case switching between them + $dirSeparator = [System.IO.Path]::DirectorySeparatorChar + if ($Release) { + $oldTarget = $target.Replace($dirSeparator + 'release', $dirSeparator + 'debug') + } + else { + $oldTarget = $target.Replace($dirSeparator + 'debug', $dirSeparator + 'release') + } + $env:PATH = $env:PATH.Replace($oldTarget, '') + + $paths = $env:PATH.Split([System.IO.Path]::PathSeparator) + $found = $false + foreach ($path in $paths) { + if ($path -eq $target) { + $found = $true + break + } } -} -# remove empty entries from path -$env:PATH = [string]::Join([System.IO.Path]::PathSeparator, $env:PATH.Split([System.IO.Path]::PathSeparator, [StringSplitOptions]::RemoveEmptyEntries)) + # remove empty entries from path + $env:PATH = [string]::Join([System.IO.Path]::PathSeparator, $env:PATH.Split([System.IO.Path]::PathSeparator, [StringSplitOptions]::RemoveEmptyEntries)) -if (!$found) { - Write-Host -ForegroundCOlor Yellow "Adding $target to `$env:PATH" - $env:PATH += [System.IO.Path]::PathSeparator + $target + if (!$found) { + Write-Host -ForegroundCOlor Yellow "Adding $target to `$env:PATH" + $env:PATH += [System.IO.Path]::PathSeparator + $target + } } if ($Test) {