Skip to content

Commit

Permalink
Reflect extendr/extendr#699 to libR-sys (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
yutannihilation authored Feb 4, 2024
1 parent d054491 commit 0ce3bfd
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions ci-cargo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,25 @@ 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
}
}
catch {
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::"
}

<#
Expand Down

0 comments on commit 0ce3bfd

Please sign in to comment.