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

tegra-helper-scripts: Fix error handling errors when flashing + Formatting #1424

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

synther
Copy link
Contributor

@synther synther commented Nov 27, 2023

Function calls under | tee -a $logfile don't propagate an error code. Some flashing errors are ignored without the fix.

And a separate commit for some formatting.

- Avoid mix of spaces and tabs.
- Make my linter happy.

Signed-off-by: Vitaly Kuzin <[email protected]>
Function calls under "| tee -a logfile" don't propagate an error code.
Some flashing errors are ignored without the fix.

Signed-off-by: Vitaly Kuzin <[email protected]>
@quaresmajose
Copy link
Contributor

quaresmajose commented Nov 27, 2023

Good finding!
Thanks for your patch

This issue can also be fixed changing the shell options with set:

#!/usr/bin/env bash
set -o errexit
set -o pipefail
...

https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html

@madisongh
Copy link
Member

errexit is probably too much, but I definitely missed set -o pipefail in the script. Setting that should simplify things, eliminating the need for extra wrapper functions.

@synther
Copy link
Contributor Author

synther commented Dec 3, 2023

I think the wrapper makes the script tidier, because it also eliminates copy-paste for log redirects. I'd keep it anyway. What do you think?

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