From ebeae4abe9b3ef2e626eb545e991bb5696c57de0 Mon Sep 17 00:00:00 2001 From: Sergey Lukin Date: Fri, 9 Nov 2012 23:53:22 +0200 Subject: Fix /bin/sh compatibility issue in install.sh --- tools/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/install.sh') diff --git a/tools/install.sh b/tools/install.sh index b080be3a1..0558c96ce 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -36,4 +36,4 @@ echo "\033[0;32m"' /____/ '"\033[0m echo "\n\n \033[0;32m....is now installed.\033[0m" /usr/bin/env zsh -source ~/.zshrc +. ~/.zshrc -- cgit v1.2.3-70-g09d2 From 5bd590ceb30ca58d96ec8d5dcfc1fec71bc6ca1f Mon Sep 17 00:00:00 2001 From: Andrew Vit Date: Sat, 8 Mar 2014 13:13:52 -0800 Subject: Reference default install path from ZSH variable --- tools/install.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tools/install.sh') diff --git a/tools/install.sh b/tools/install.sh index b24bb4ad3..01984ea2b 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -1,16 +1,16 @@ -ZSH=`/usr/bin/env|grep 'ZSH='|cut -d '=' -f 2` -if [ -d "$ZSH" ] +if [ ! -n $ZSH ] then - echo "\033[0;33mYou already have Oh My Zsh installed.\033[0m You'll need to remove $ZSH if you want to install" - exit -elif [ -d ~/.oh-my-zsh ] + ZSH=~/.oh-my-zsh +fi + +if [ -d $ZSH ] then - echo "\033[0;33mYou already have One Oh My Zsh Directory.\033[0m You'll need to remove ~/.oh-my-zsh if you want to clone" + echo "\033[0;33mYou already have Oh My Zsh installed.\033[0m You'll need to remove $ZSH if you want to install" exit fi echo "\033[0;34mCloning Oh My Zsh...\033[0m" -hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh || { +hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git $ZSH || { echo "git not installed" exit } @@ -23,7 +23,7 @@ then fi echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m" -cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc +cp $ZSH/templates/zshrc.zsh-template ~/.zshrc echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" sed -i -e "/export PATH=/ c\\ -- cgit v1.2.3-70-g09d2 From 2e11e2ab5adaea762b7f2eaa6c63332a9618bb3f Mon Sep 17 00:00:00 2001 From: Andrew Vit Date: Sat, 8 Mar 2014 13:15:18 -0800 Subject: Write install path into .zshrc --- tools/install.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tools/install.sh') diff --git a/tools/install.sh b/tools/install.sh index 01984ea2b..5c7a5b6ca 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -24,6 +24,9 @@ fi echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m" cp $ZSH/templates/zshrc.zsh-template ~/.zshrc +sed -i -e "/^ZSH=/ c\\ +ZSH=$ZSH +" ~/.zshrc echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" sed -i -e "/export PATH=/ c\\ -- cgit v1.2.3-70-g09d2 From da1fa3b06a6369a5b3337025da164eeec275db70 Mon Sep 17 00:00:00 2001 From: Andrew Vit Date: Sat, 8 Mar 2014 13:17:16 -0800 Subject: Abort installer on errors --- tools/install.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tools/install.sh') diff --git a/tools/install.sh b/tools/install.sh index 5c7a5b6ca..343f251ae 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -1,3 +1,5 @@ +set -e + if [ ! -n $ZSH ] then ZSH=~/.oh-my-zsh -- cgit v1.2.3-70-g09d2 From 47b0d754ae368af16957903f203ee902c7faeec1 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 13 Mar 2014 10:15:18 -0700 Subject: Fixing a few quirks in the latest installer updates (quoting /Users/robbyrussell/.oh-my-zsh and such). Also mentioining our twitter account after install --- tools/install.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'tools/install.sh') diff --git a/tools/install.sh b/tools/install.sh index 343f251ae..71e19a389 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -1,12 +1,10 @@ set -e -if [ ! -n $ZSH ] -then +if [ ! -n "$ZSH" ]; then ZSH=~/.oh-my-zsh fi -if [ -d $ZSH ] -then +if [ -d "$ZSH" ]; then echo "\033[0;33mYou already have Oh My Zsh installed.\033[0m You'll need to remove $ZSH if you want to install" exit fi @@ -18,8 +16,7 @@ hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh } echo "\033[0;34mLooking for an existing zsh config...\033[0m" -if [ -f ~/.zshrc ] || [ -h ~/.zshrc ] -then +if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32mBacking up to ~/.zshrc.pre-oh-my-zsh\033[0m"; mv ~/.zshrc ~/.zshrc.pre-oh-my-zsh; fi @@ -43,9 +40,8 @@ echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" -echo "\033[0;32m"' /____/ '"\033[0m" - -echo "\n\n \033[0;32m....is now installed.\033[0m" +echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m" echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m" +echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m" /usr/bin/env zsh . ~/.zshrc -- cgit v1.2.3-70-g09d2