summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/install.sh16
-rw-r--r--tools/upgrade.sh2
2 files changed, 13 insertions, 5 deletions
diff --git a/tools/install.sh b/tools/install.sh
index beec750c3..e8dffe3c7 100755
--- a/tools/install.sh
+++ b/tools/install.sh
@@ -18,6 +18,12 @@ else
BOLD=""
NORMAL=""
fi
+CHECK_ZSH_INSTALLED=$(grep /zsh$ /etc/shells | wc -l)
+if [ ! $CHECK_ZSH_INSTALLED -ge 1 ]; then
+ echo "${YELLOW}Zsh is not installed!${NORMAL} Please install zsh first!"
+ exit
+fi
+unset CHECK_ZSH_INSTALLED
if [ ! -n "$ZSH" ]; then
ZSH=~/.oh-my-zsh
@@ -43,14 +49,16 @@ fi
printf "${BLUE}Using the Oh My Zsh template file and adding it to ~/.zshrc${NORMAL}\n"
cp $ZSH/templates/zshrc.zsh-template ~/.zshrc
-sed -i -e "/^export ZSH=/ c\\
+sed "/^export ZSH=/ c\\
export ZSH=$ZSH
-" ~/.zshrc
+" ~/.zshrc > ~/.zshrc-omztemp
+mv -f ~/.zshrc-omztemp ~/.zshrc
printf "${BLUE}Copying your current PATH and adding it to the end of ~/.zshrc for you.${NORMAL}\n"
-sed -i -e "/export PATH=/ c\\
+sed "/export PATH=/ c\\
export PATH=\"$PATH\"
-" ~/.zshrc
+" ~/.zshrc > ~/.zshrc-omztemp
+mv -f ~/.zshrc-omztemp ~/.zshrc
TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)')
if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then
diff --git a/tools/upgrade.sh b/tools/upgrade.sh
index 59b380116..65af6e368 100644
--- a/tools/upgrade.sh
+++ b/tools/upgrade.sh
@@ -3,7 +3,7 @@
# supports them.
ncolors=$(tput colors)
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
- RED=="$(tput setaf 1)"
+ RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"