diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/install.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/install.sh b/tools/install.sh index 5633320a8..dd9c4f842 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -1,5 +1,4 @@ -set -e - +function main() { # Use colors, but only if connected to a terminal, and that terminal # supports them. tput=$(which tput) @@ -21,6 +20,11 @@ else BOLD="" NORMAL="" fi + +# Only enable exit-on-error after the non-critical colorization stuff, +# which may fail on systems lacking tput or terminfo +set -e + CHECK_ZSH_INSTALLED=$(grep /zsh$ /etc/shells | wc -l) if [ ! $CHECK_ZSH_INSTALLED -ge 1 ]; then printf "${YELLOW}Zsh is not installed!${NORMAL} Please install zsh first!\n" @@ -114,3 +118,6 @@ echo 'p.p.s. Get stickers and t-shirts at http://shop.planetargon.com.' echo '' printf "${NORMAL}" env zsh +} + +main |