From 9baff7dfd18f22bcaa7987652a8e5324aae3b8ce Mon Sep 17 00:00:00 2001 From: Casey Watson Date: Mon, 12 Sep 2011 08:51:01 -0600 Subject: [PATCH 1/2] invoke upgrade script with zsh so the builtin echo is used --- tools/check_for_upgrade.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index e1e4eb99f..1a6ddf2c3 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -19,12 +19,15 @@ then epoch_diff=$(($(_current_epoch) - $LAST_EPOCH)) if [ $epoch_diff -gt 6 ] then + if [ -z "$ZSH" ] + ZSH=$HOME/.oh-my-zsh + echo $SHELL echo "[Oh My Zsh] Would you like to check for updates?" echo "Type Y to update oh-my-zsh: \c" read line if [ "$line" = Y ] || [ "$line" = y ] then - /bin/sh $ZSH/tools/upgrade.sh + $SHELL "$ZSH/tools/upgrade.sh" # update the zsh file _update_zsh_update fi From 579613bf6cb0b98da2220e3393e641d0b4295251 Mon Sep 17 00:00:00 2001 From: Casey Watson Date: Mon, 12 Sep 2011 08:51:41 -0600 Subject: [PATCH 2/2] quote ZSH var in upgrade script. fixes broken osx upgrades --- tools/upgrade.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 52a8cc4da..d941a15ad 100644 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -1,6 +1,6 @@ current_path=`pwd` echo -e "\033[0;34mUpgrading Oh My Zsh\033[0m" -( cd $ZSH && git pull origin master ) +( cd "$ZSH" && git pull origin master ) echo -e "\033[0;32m"' __ __ '"\033[0m" echo -e "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" echo -e "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m"