Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit on failing command #10

Merged
merged 3 commits into from
Feb 7, 2019
Merged

Conversation

daneov
Copy link
Collaborator

@daneov daneov commented Feb 7, 2019

Following on #7 this PR introduces/fixes the following behaviour:
In the case of a command failure Komondor will:

  • Print the error message and exits with the error code of the failed command
  • In case of any other type of error Komondor will exit with status 1 and print the raw description of the error

Aside from that, I introduced the following small changes:

  • Make the 'happy path' more explicit by using a guard to check if arguments are passed or not
  • The resulting value from the try shellOut(to: command) is printed - this is only after the command has been executed.
    • ⚠️ I tried passing the correct FileHandler to shellOut in an attempt to print the output in real time, rather than after completing the action, but there are some bugs in shellOut that prevent us from doing this.

@orta
Copy link
Member

orta commented Feb 7, 2019

My preference is to not output by default - but I'm open to giving this a shot 👍

@orta orta merged commit df2f514 into shibapm:master Feb 7, 2019
@daneov daneov deleted the exit_on_failing_command branch March 11, 2021 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants