-
Notifications
You must be signed in to change notification settings - Fork 450
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
Improve error message in update.sh when updater is corrupt. #2766
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2766 +/- ##
==========================================
- Coverage 47.14% 47.10% -0.04%
==========================================
Files 349 349
Lines 56322 56322
==========================================
- Hits 26553 26531 -22
- Misses 26800 26818 +18
- Partials 2969 2973 +4
Continue to review full report at Codecov.
|
# check if the updater binary exist. | ||
if [ -f "${SCRIPTPATH}/updater" ]; then | ||
# check if the updater binary exist and is not empty. | ||
if [[ -s "${SCRIPTPATH}/updater" && -f "${SCRIPTPATH}/updater" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please check this line with shellcheck ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shellcheck doesn't have anything to say about this line
Summary
A user reported a strange and not very helpful error message. This was due to incomplete error handling in the bash script relating to a truncated
updater
binary.The current workaround for this is to delete the
updater
binary and triggerupdate.sh
to re-download it, but this is not obvious and I wouldn't expect any user to reach that conclusion.This fix adds error handling in case
updater
fails and should fix this particular failure.Here is the error message:
Test Plan
Ran some tests against a directory, empty file, and regular file in my shell: