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

Issue #80: Raise build error on failed shell command. #81

Merged
merged 4 commits into from
May 30, 2017

Conversation

guncha25
Copy link
Contributor

Make build more predictable by raising error if shell exited with non zero exit status.
Fixes list shell commands.

@ragnarkurmwunder
Copy link

I see the PR is good refactor.
Does it output stdout and stderr of failed command?
It does not report error code, which is valuable in some cases.

@guncha25
Copy link
Contributor Author

It outputs failed command. I think error is outputted by itself. Its was just not clear on what command error occurred.

@ragnarkurmwunder
Copy link

For the error code part, I would suggest something like this:

exit_code = os.system(command)
if exit_code <> 0:
    raise BuildError("Failed executing: '" + command + "' (Exit code: " + str(exit_code) + ")")

Note that I have included additional single quotes around the command for better visual.

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.

3 participants