Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgrade: Modify upgrade scripts to handle failure.
The current `upgrade-zulip` and `upgrade-zulip-from-git` bash scripts exit with a zero status even if the upgrade commands exit with a non-zero status. Hence add `set -e` command which exits the script with the same status as the non-zero command. For pipe commands however, the net status of a command is the status of the last command, hence if the other parts fail, the net status is only determined by the last command. This is the case with our main /lib/upgrade-zulip* command in the scripts whose status is determined by the `tee` command instead. Hence add a small condition to get the status of the actual upgrade command and exit the script if it fails with a non-zero command. We also check whether the script is being run as root, matching the install script logic.
- Loading branch information