Skip to content

Commit

Permalink
Fix exit code not falling through
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacSweers committed Jun 15, 2023
1 parent 8843b60 commit e8c3d17
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/kotlin/slack/cli/exec/ProcessedExecCli.kt
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ public class ProcessedExecCli :
tmpDir.createDirectories()

// Initial command execution
val (exitStatus, logFile) = executeCommand(cmd, tmpDir)
while (exitStatus != 0) {
echo("Command failed with exit code $exitStatus. Running processor script...")
val (exitCode, logFile) = executeCommand(cmd, tmpDir)
while (exitCode != 0) {
echo("Command failed with exit code $exitCode. Running processor script...")

echo("Processing CI failure")
val resultProcessor = ResultProcessor(verbose, bugsnagKey, config, ::echo)
Expand Down Expand Up @@ -108,7 +108,7 @@ public class ProcessedExecCli :
// If we got here, all is well
// Delete the tmp files
tmpDir.deleteRecursively()
exitProcess(0)
exitProcess(exitCode)
}

// Function to execute command and capture output. Shorthand to the testable top-level function.
Expand Down

0 comments on commit e8c3d17

Please sign in to comment.