From ad6a2e30a9214fa2666bdf60aa51f11f9ad06014 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Sat, 17 Feb 2024 15:35:58 +0000 Subject: [PATCH] Suppress MacOS package manager output Suppress unnecessary output from `Start-PSBootstrap`, e.g.: ```log Warning: wget 1.21.4 is already installed and up-to-date. To reinstall 1.21.4, run: brew reinstall wget ``` --- build.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.psm1 b/build.psm1 index 8fdd00cac5c..25c44727cb7 100644 --- a/build.psm1 +++ b/build.psm1 @@ -2214,9 +2214,9 @@ function Start-PSBootstrap { } } elseif ($environment.IsMacOS) { if ($environment.UsingHomebrew) { - $PackageManager = "brew" + $baseCommand = "brew install --quiet" } elseif ($environment.UsingMacports) { - $PackageManager = "$sudo port" + $baseCommand = "$sudo port -q install" } # wget for downloading dotnet @@ -2227,7 +2227,7 @@ function Start-PSBootstrap { # Install dependencies # ignore exitcode, because they may be already installed - Start-NativeExecution ([ScriptBlock]::Create("$PackageManager install $Deps")) -IgnoreExitcode + Start-NativeExecution ([ScriptBlock]::Create("$baseCommand $Deps")) -IgnoreExitcode } elseif ($environment.IsLinux -and $environment.IsAlpine) { $Deps += 'libunwind', 'libcurl', 'bash', 'build-base', 'git', 'curl', 'wget'