fixed #149 - corrected output from the installer script

This commit is contained in:
Bozhidar Batsov 2012-05-11 13:36:57 +03:00
parent 1253ea8a84
commit a813a50825

View file

@ -1,44 +1,47 @@
#!/bin/bash
PRELUDE_INSTALL_DIR="$HOME/.emacs.d" PRELUDE_INSTALL_DIR="$HOME/.emacs.d"
PRELUDE_URL=https://github.com/bbatsov/prelude.git PRELUDE_URL=https://github.com/bbatsov/prelude.git
echo -n "Checking to see if git is installed... "
hash git 2>&- || { echo >&2 "not found. Aborting installation!"; exit 1; }
echo "found"
echo -n "Checking to see if aspell is installed... "
hash aspell 2>&- || { echo >&2 "not found. Install aspell to benefit from flyspell-mode!"; }
echo "found"
echo -n "Checking to see if ack is installed... "
hash ack 2>&- || { echo >&2 "not found. You'll need it to use ack-and-a-half!"; }
echo "found"
echo -n "Looking for an existing Emacs config..."
if [ -d $PRELUDE_INSTALL_DIR ] if [ -d $PRELUDE_INSTALL_DIR ]
then then
echo "Found an existing $PRELUDE_INSTALL_DIR. Backing it up to $PRELUDE_INSTALL_DIR.pre-prelude" printf "\e[33m You already have Prelude installed.\e[0m You'll need to remove $PRELUDE_INSTALL_DIR if you want to install Prelude again.\n"
mv $PRELUDE_INSTALL_DIR $PRELUDE_INSTALL_DIR.pre-prelude exit 1;
fi fi
if [ -f ~/.emacs ] printf "Checking to see if git is installed... "
hash git 2>&- || { printf >&2 "\e[33mnot found. Aborting installation!\e[0m"; exit 1; }
printf "\e[32mfound.\e[0m\n"
printf "Checking to see if aspell is installed... "
hash aspell 2>&- || { printf >&2 "\e[33mnot found. Install aspell to benefit from flyspell-mode!\e[0m"; }
printf "\e[32mfound.\e[0m\n"
printf "Checking to see if ack is installed... "
hash ack 2>&- || { printf >&2 "\e[33mnot found. You'll need it to use ack-and-a-half!\e[0m"; }
printf "\e[32mfound.\e[0m\n"
printf "Looking for an existing Emacs config... "
if [ -d $PRELUDE_INSTALL_DIR ]
then then
echo "Found an existing ~/.emacs. Backing it up to ~/.emacs.pre-prelude" printf "\e[33mfound an existing $PRELUDE_INSTALL_DIR.\e[0m Backing it up to $PRELUDE_INSTALL_DIR.pre-prelude.\n"
mv ~/.emacs ~/.emacs.pre-prelude mv $PRELUDE_INSTALL_DIR $PRELUDE_INSTALL_DIR.pre-prelude
elif [ -f ~/.emacs ]
then
printf "\e[33mfound an existing ~/.emacs.\e[0m Backing it up to ~/.emacs.pre-prelude.\n"
mv ~/.emacs ~/.emacs.pre-prelude
else
printf "\e[32mnot found.\e[0m\n"
fi fi
echo -n "Cloning Emacs Prelude from GitHub... " printf "Cloning Emacs Prelude from GitHub... "
/usr/bin/env git clone $PRELUDE_URL $PRELUDE_INSTALL_DIR > /dev/null /usr/bin/env git clone $PRELUDE_URL $PRELUDE_INSTALL_DIR > /dev/null 2>&1
cd $PRELUDE_INSTALL_DIR cd $PRELUDE_INSTALL_DIR
echo "done." printf "done.\n\n"
echo -e '\e[34m ____ _ _ ' printf "\e[34m ____ _ _ \n"
echo -e '\e[34m| _ \ _ __ ___| |_ _ __| | ___ ' printf "\e[34m| _ \ _ __ ___| |_ _ __| | ___ \n"
echo -e '\e[34m| |_) | __/ _ \ | | | |/ _ |/ _ \' printf "\e[34m| |_) | __/ _ \ | | | |/ _ |/ _ \ \n"
echo -e '\e[34m| __/| | | __/ | |_| | (_| | __/' printf "\e[34m| __/| | | __/ | |_| | (_| | __/ \n"
echo -e '\e[34m|_| |_| \___|_|\__,_|\__,_|\___|' printf "\e[34m|_| |_| \___|_|\__,_|\__,_|\___| \n"
printf "\e[32m... is now installed and ready to do thy bidding, Master $USER!\n"
echo -e '\e[32m... is now installed and ready to do thy bidding!' printf "\e[0m"
echo -e '\e[0m'