Skip to content

Commit

Permalink
Merge pull request #538 from Fryguy/better_exit
Browse files Browse the repository at this point in the history
Fix issues where exitstatus could be nil
  • Loading branch information
jrafanie authored Jan 3, 2025
2 parents 9ac5a5c + 6324841 commit 43e6a84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/manageiq/rpm_build/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ def where_am_i

def shell_cmd(cmd, env = {})
puts_shell_cmd(cmd, env)
exit $?.exitstatus unless system(env, cmd.to_s)
exit($?.exitstatus || 1) unless system(env, cmd.to_s)
end

def shell_cmd_in_venv(cmd, venv, env = {})
puts_shell_cmd(cmd, env, "(venv)")
cmd = "source #{venv.join("bin/activate")}; #{cmd}; deactivate"
exit $?.exitstatus unless system(env, cmd.to_s)
exit($?.exitstatus || 1) unless system(env, cmd.to_s)
end

def puts_shell_cmd(cmd, env, prefix = "")
Expand Down

0 comments on commit 43e6a84

Please sign in to comment.