From e81adf238d4bb51021cac19bd4f49d4f6c7991ae Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Tue, 15 Jul 2014 20:47:31 +0200 Subject: [PATCH] Check for ~/.dot_is_server for green prompt; install script facilitates this and now asks whether hg extensions are wanted --- .bashrc | 2 +- install.sh | 55 +++++++++++++++++++++++++++++++++++++----------------- 2 files changed, 39 insertions(+), 18 deletions(-) diff --git a/.bashrc b/.bashrc index 89022e4..dbc1573 100644 --- a/.bashrc +++ b/.bashrc @@ -76,7 +76,7 @@ if [ "$color_prompt" = yes ]; then YELLOW="\[\033[0;33m\]" GREEN="\[\033[0;32m\]" PROMPT_SYMBOL='$' - if [ "${HOSTNAME}" = "higgs.aquariusoft.org" ] || [ "${HOSTNAME}" = "medusa" ]; then + if [ -e ~/.dot_is_server ]; then PS1="$YELLOW\t $GREEN\u$BLACK@\h:\W$ " else PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$ " diff --git a/install.sh b/install.sh index bf472a2..72005cc 100644 --- a/install.sh +++ b/install.sh @@ -1,6 +1,30 @@ #!/bin/sh # inspired by rrix' dotfiles +install_hg() +{ +break + # Mercurial extensions + touch ~/.dot_has_hg + HGDIR=~/workspace/application_addons/mercurial + mkdir -p $HGDIR + cd $HGDIR + + for REPO in Mekk/mercurial_keyring sjl/hg-prompt durin42/hg-git yujiewu/hgflow + do + REPODIR="${REPO##*/}" + echo $REPODIR + if [ ! -d "$HGDIR/$REPODIR" ]; then + hg clone http://bitbucket.org/$REPO + #echo http://bitbucket.org/$REPO + else + cd $HGDIR/$REPODIR + #echo $HGDIR/$REPODIR + hg pull -u + fi + done +} + DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $DIR @@ -22,21 +46,18 @@ fi echo "INFO: Vundle Install" vim +BundleInstall +qall -# Mercurial extensions -HGDIR=~/workspace/application_addons/mercurial -mkdir -p $HGDIR -cd $HGDIR - -for REPO in Mekk/mercurial_keyring sjl/hg-prompt durin42/hg-git yujiewu/hgflow -do - REPODIR="${REPO##*/}" - echo $REPODIR - if [ ! -d "$HGDIR/$REPODIR" ]; then - hg clone http://bitbucket.org/$REPO - #echo http://bitbucket.org/$REPO - else - cd $HGDIR/$REPODIR - #echo $HGDIR/$REPODIR - hg pull -u - fi +echo "Do you wish to install mercurial stuff?" +select yn in "Yes" "No"; do + case $yn in + Yes ) install_hg; break;; + No ) break;; + esac +done + +echo "Is this machine a server?" +select yn in "Yes" "No"; do + case $yn in + Yes ) touch ~/.dot_is_server; break;; + No ) break;; + esac done