From 860ba6366e60e9bd1b06fbcd0338c04975ff377f Mon Sep 17 00:00:00 2001 From: Yinka Erinle Date: Wed, 17 Oct 2012 19:56:12 +0100 Subject: [PATCH] Adding zshrc setup to installation script --- srv/scripts/install.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/srv/scripts/install.sh b/srv/scripts/install.sh index dc793f6a..f67ff257 100755 --- a/srv/scripts/install.sh +++ b/srv/scripts/install.sh @@ -139,6 +139,7 @@ SNIPPET='[[ -s "$HOME/.gvm/bin/gvm-init.sh" ]] && source "$HOME/.gvm/bin/gvm-ini BASH_PROFILE="$HOME/.bash_profile" PROFILE="$HOME/.profile" BASHRC="$HOME/.bashrc" +ZSHRC="$HOME/.zshrc" if [ ! -f "$BASH_PROFILE" -a ! -f "$PROFILE" ]; then echo "#!/bin/bash" > "$BASH_PROFILE" @@ -171,6 +172,17 @@ else fi fi +if [ ! -f "$ZSHRC" ]; then + echo "#!/bin/bash" > "$ZSHRC" + echo "$SNIPPET" >> "$ZSHRC" + echo "Created and initialised $ZSHRC" +else + if [ -z "$(grep 'gvm-init.sh' $ZSHRC)" ]; then + echo -e "\n$SNIPPET" >> "$ZSHRC" + echo "Updated existing $ZSHRC" + fi +fi + echo "All done!" echo ""