Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Properly exit process if function
distro_version
fails
`distro_version` contains code that can run `exit`, which is supposed to exit the whole process. However, `distro_version` runs in a subshell. By default in Bash, this means that `exit` will only exit the subshell, and set `?` to that exit code. The rest of script will execute, despite the error. There are two ways to fix this: - Enable the POSIX shell option `errexit` for the entire script - Manually check for non-zero exit code and "cascade the error" The latter was chosen because it is a localized change that does not affect the behavior of the entire script.
- Loading branch information