summaryrefslogtreecommitdiff
path: root/tools/check_for_upgrade.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/check_for_upgrade.sh')
-rw-r--r--tools/check_for_upgrade.sh11
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
index 4a0803210..881bc6c49 100644
--- a/tools/check_for_upgrade.sh
+++ b/tools/check_for_upgrade.sh
@@ -22,12 +22,13 @@ if [[ -z "$epoch_target" ]]; then
epoch_target=13
fi
-[ -f ~/.profile ] && source ~/.profile
-
# Cancel upgrade if the current user doesn't have write permissions for the
# 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
@@ -43,10 +44,9 @@ then
then
_upgrade_zsh
else
- echo "[Oh My Zsh] Would you like to check for updates?"
- echo "Type Y to update oh-my-zsh: \c"
+ echo "[Oh My Zsh] Would you like to check for updates? [Y/n]: \c"
read line
- if [ "$line" = Y ] || [ "$line" = y ]; then
+ if [[ "$line" == Y* ]] || [[ "$line" == y* ]] || [ -z "$line" ]; then
_upgrade_zsh
else
_update_zsh_update
@@ -57,4 +57,3 @@ else
# create the zsh file
_update_zsh_update
fi
-