summaryrefslogtreecommitdiff
path: root/tools/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/install.sh')
-rwxr-xr-xtools/install.sh16
1 files changed, 7 insertions, 9 deletions
diff --git a/tools/install.sh b/tools/install.sh
index 3f4de8681..0cc020053 100755
--- a/tools/install.sh
+++ b/tools/install.sh
@@ -24,12 +24,10 @@ main() {
# 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
+ if ! command -v zsh >/dev/null 2>&1; then
printf "${YELLOW}Zsh is not installed!${NORMAL} Please install zsh first!\n"
exit
fi
- unset CHECK_ZSH_INSTALLED
if [ ! -n "$ZSH" ]; then
ZSH=~/.oh-my-zsh
@@ -49,7 +47,7 @@ main() {
umask g-w,o-w
printf "${BLUE}Cloning Oh My Zsh...${NORMAL}\n"
- hash git >/dev/null 2>&1 || {
+ command -v git >/dev/null 2>&1 || {
echo "Error: git is not installed"
exit 1
}
@@ -61,7 +59,7 @@ main() {
exit 1
fi
fi
- env git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git $ZSH || {
+ env git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git "$ZSH" || {
printf "Error: git clone of oh-my-zsh repo failed\n"
exit 1
}
@@ -74,9 +72,9 @@ main() {
fi
printf "${BLUE}Using the Oh My Zsh template file and adding it to ~/.zshrc${NORMAL}\n"
- cp $ZSH/templates/zshrc.zsh-template ~/.zshrc
+ cp "$ZSH"/templates/zshrc.zsh-template ~/.zshrc
sed "/^export ZSH=/ c\\
- export ZSH=$ZSH
+ export ZSH=\"$ZSH\"
" ~/.zshrc > ~/.zshrc-omztemp
mv -f ~/.zshrc-omztemp ~/.zshrc
@@ -107,10 +105,10 @@ main() {
echo ''
echo 'p.s. Follow us at https://twitter.com/ohmyzsh.'
echo ''
- echo 'p.p.s. Get stickers and t-shirts at http://shop.planetargon.com.'
+ echo 'p.p.s. Get stickers and t-shirts at https://shop.planetargon.com.'
echo ''
printf "${NORMAL}"
- env zsh
+ env zsh -l
}
main