From 18385ea65c1a5f7698e8b333c5d49f2a7bc651d6 Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Sun, 4 Feb 2024 09:55:36 +0900 Subject: [PATCH] Reflect extendr/extendr#699 to libR-sys --- ci-cargo.ps1 | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/ci-cargo.ps1 b/ci-cargo.ps1 index 0e5adfd3..71cc0071 100644 --- a/ci-cargo.ps1 +++ b/ci-cargo.ps1 @@ -9,11 +9,12 @@ function ci-cargo { ) - try { - echo "::group::$ActionName" - echo "Running cargo $CargoArgs" + try { + Write-Output "::group::$ActionName" + $CargoArgs = $CargoArgs | Where-Object { -not [string]::IsNullOrWhiteSpace($_) } + Write-Output "Running cargo $CargoArgs" cargo $CargoArgs - if($LASTEXITCODE -ne 0) { + if ($LASTEXITCODE -ne 0) { throw $LASTEXITCODE } } @@ -21,12 +22,12 @@ function ci-cargo { if ($ActionName -ne $null -and $ActionName -ne "") { $ActionName = "'$ActionName': " } - $err_msg = "$($ActionName)cargo failed with code $LASTEXITCODE (args: $CargoArgs)" - echo "::error::$err_msg" - Write-Error -Message "$err_msg" -ErrorAction Stop + $errMsg = "$($ActionName)cargo failed with code $LASTEXITCODE (args: $CargoArgs)" + Write-Output "::error::$errMsg" + Write-Error -Message "$errMsg" -ErrorAction Stop } finally { - echo "::endgroup::" + Write-Output "::endgroup::" } <#