-
Notifications
You must be signed in to change notification settings - Fork 513
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
updater.sh returns with exit code 0 when failing in update_userjs #1810
Comments
I'll let someone else who knows what they're doing handle this request/suggestion (earthlng usually pops in once a month) |
There are already checks to handle this: Line 115 in 33a84b6
Lines 250 to 251 in 33a84b6
Please post the output you are getting @odhil |
after disabling network connection...
this is a problem if the script is run from another script |
unrelated, but shellcheck says...
|
been over two months since requested and I consider this an (expected) edge case |
I think I found the reason. update_userjs function returns 1. this is OK. But after that function, you also call another command ("cd" command) which returns 0. Here is the line: Line 407 in 33a84b6
Shell scripts always return the last exit/return code. Therefore you got 0. I will not open a pull request. Because I don't know why the script needs the "cd" command on the last phase. As a temporary solution, you can can store the last-exit-code and return it: update_userjs
LAST_EXIT_CODE="$?"
cd "$CURRDIR"
exit $LAST_EXIT_CODE |
I already suggested a simpler fix in #1828. The last |
updater.sh returns with exit code 0 when failing to download user.js file, for example, when no internet connection. The assumed result would be to return a non-zero exit code. This way, if the updater fails, one can retry after some time.
One way to solve would be by explicitly returning 0 at the end of update_userjs function when it completes succesfully and calling update_userjs || exit 1 to exit when the update_userjs function returns non-zero value.
The text was updated successfully, but these errors were encountered: