summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/check_for_upgrade.sh4
-rwxr-xr-xtools/install.sh11
2 files changed, 12 insertions, 3 deletions
diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
index 5afd83c1e..1c897cb36 100644
--- a/tools/check_for_upgrade.sh
+++ b/tools/check_for_upgrade.sh
@@ -26,6 +26,9 @@ fi
# oh-my-zsh directory.
[[ -w "$ZSH" ]] || return 0
+# Cancel upgrade if git is unavailable on the system
+whence git >/dev/null || return 0
+
if [ -f ~/.zsh-update ]
then
. ~/.zsh-update
@@ -54,4 +57,3 @@ else
# create the zsh file
_update_zsh_update
fi
-
diff --git a/tools/install.sh b/tools/install.sh
index 542bf97c2..e65905025 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.
if which tput >/dev/null 2>&1; then
@@ -20,6 +19,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"
@@ -113,3 +117,6 @@ echo 'p.p.s. Get stickers and t-shirts at http://shop.planetargon.com.'
echo ''
printf "${NORMAL}"
env zsh
+}
+
+main