Merge pull request #189 from fbs/new-installer

Installer updates.
This commit is contained in:
Bozhidar Batsov 2012-06-23 02:54:10 -07:00
commit a027018eb9
2 changed files with 74 additions and 78 deletions

View file

View file

@ -16,12 +16,9 @@ install_prelude () {
make_prelude_dirs () {
printf " Making the required directories.\n$RESET"
mkdir $PRELUDE_INSTALL_DIR/vendor $PRELUDE_INSTALL_DIR/personal > /dev/null 2>&1
mkdir $PRELUDE_INSTALL_DIR/themes $PRELUDE_INSTALL_DIR/snippets > /dev/null 2>&1
if ! [ $? -eq 0 ]
then
printf "$RED failed to create directories.\n$RESET"
fi
mkdir $PRELUDE_INSTALL_DIR/vendor $PRELUDE_INSTALL_DIR/personal
mkdir $PRELUDE_INSTALL_DIR/themes $PRELUDE_INSTALL_DIR/snippets
mkdir $PRELUDE_INSTALL_DIR/savefile
}
colors () {
@ -122,8 +119,8 @@ done
VERBOSE_COLOR=$BBLUE
[ -z $PRELUDE_URL ] && PRELUDE_URL='https://github.com/bbatsov/prelude.git'
[ -z $PRELUDE_INSTALL_DIR ] && PRELUDE_INSTALL_DIR='$HOME/.emacs.d'
[ -z $PRELUDE_URL ] && PRELUDE_URL="https://github.com/bbatsov/prelude.git"
[ -z $PRELUDE_INSTALL_DIR ] && PRELUDE_INSTALL_DIR="$HOME/.emacs.d"
if [ x$PRELUDE_VERBOSE != x ]
then
@ -142,6 +139,15 @@ then
printf "$RESET"
fi
# If prelude is already installed
if [ -d $PRELUDE_INSTALL_DIR/prelude ]
then
printf "\n\n$BRED"
printf "You already have Prelude installed.$RESET\nYou'll need to remove $PRELUDE_INSTALL_DIR/prelude if you want to install Prelude again.\n"
printf "If you want to update your copy of prelude, run 'git pull origin master' from your prelude directory\n\n"
exit 1;
fi
### Check dependencies
printf "$CYAN Checking to see if git is installed... $RESET"
if hash git 2>&-
@ -174,15 +180,6 @@ then
printf "$YELLOW WARNING:$RESET Prelude depends on emacs $RED 24$RESET !\n"
fi
# If prelude is already installed
if [ -d $PRELUDE_INSTALL_DIR/prelude ]
then
printf "\n\n$BRED"
printf "You already have Prelude installed.$RESET\nYou'll need to remove $PRELUDE_INSTALL_DIR/prelude if you want to install Prelude again.\n"
printf "If you want to update your copy of prelude, run 'git pull origin master' from your prelude directory\n\n"
exit 1;
fi
if [ -d $PRELUDE_INSTALL_DIR ] || [ -f $PRELUDE_INSTALL_DIR ]
then
# Existing file/directory found -> backup
@ -192,7 +189,7 @@ then
if [ -n $PRELUDE_INTO ]
then
# Install into existing config
PRELUDE_INSTALL_DIR+='/prelude'
PRELUDE_INSTALL_DIR=$PRELUDE_INSTALL_DIR"/prelude"
install_prelude
else
# Replace existing config
@ -221,7 +218,6 @@ then
if [ x$PRELUDE_VERBOSE != x ]
then
emacs -batch -f batch-byte-compile $PRELUDE_INSTALL_DIR/prelude/*.el
emacs -batch -f batch-byte-compile "$PRELUDE_INSTALL_DIR/prelude/*.el"
else
emacs -batch -f batch-byte-compile $PRELUDE_INSTALL_DIR/prelude/*.el > /dev/null 2>&1
fi
@ -233,12 +229,12 @@ else
fi
# Print usage message if prelude didn't replace .emacs.d
if [ $PRELUDE_INSTALL_DIR != "$HOME/.emacs.d" ]
then
printf "\n To use prelude, add: $CYAN\n (defvar prelude-dir \"$PRELUDE_INSTALL_DIR/\")\n"
printf " (load-file (concat prelude-dir \"init.el\"))\n$RESET"
printf " To your emacs init file.\n\n"
fi
# if [ $PRELUDE_INSTALL_DIR != "$HOME/.emacs.d" ]
# then
# printf "\n To use prelude, add: $CYAN\n (defvar prelude-dir \"$PRELUDE_INSTALL_DIR/\")\n"
# printf " (load-file (concat prelude-dir \"init.el\"))\n$RESET"
# printf " To your emacs init file.\n\n"
# fi
printf "\n"
printf "$BBLUE ____ _ _ \n"