From 6e00b232e8f103eea5740d16afc3a3642477fd32 Mon Sep 17 00:00:00 2001 From: sebokopter Date: Sat, 17 Nov 2012 14:03:04 +0100 Subject: [PATCH] removed Jekyll stuff as it should be in the extension directories deleted jekyll template template/jekyllconfig.template.bash removed sourcing of jekyll config from bash_it.sh and moved it to plugins/available/jekyll.plugin.bash * install.sh: removed jekyll stuff and improved .bash_profile handling changed name from .bash_profile.bak to .bash_profile.orig inserted option to append original .bash_profile to the new one --- bash_it.sh | 7 ---- install.sh | 50 ++++++++++++++++------------ plugins/available/jekyll.plugin.bash | 9 +++++ template/jekyllconfig.template.bash | 21 ------------ 4 files changed, 37 insertions(+), 50 deletions(-) delete mode 100644 template/jekyllconfig.template.bash diff --git a/bash_it.sh b/bash_it.sh index 226213fd..6bcf4cb5 100755 --- a/bash_it.sh +++ b/bash_it.sh @@ -68,10 +68,3 @@ fi PREVIEW="less" [ -s /usr/bin/gloobus-preview ] && PREVIEW="gloobus-preview" [ -s /Applications/Preview.app ] && PREVIEW="/Applications/Preview.app" - -# Load all the Jekyll stuff - -if [ -e $HOME/.jekyllconfig ] -then - . $HOME/.jekyllconfig -fi diff --git a/install.sh b/install.sh index 0f1da39c..b1f5c2ca 100755 --- a/install.sh +++ b/install.sh @@ -1,32 +1,38 @@ #!/usr/bin/env bash BASH_IT="$HOME/.bash_it" -cp $HOME/.bash_profile $HOME/.bash_profile.bak - -echo "Your original .bash_profile has been backed up to .bash_profile.bak" +if [ -e $HOME/.bash_profile ]; then + cp $HOME/.bash_profile $HOME/.bash_profile.orig + echo "Your original .bash_profile has been backed up to .bash_profile.orig" +fi cp $HOME/.bash_it/template/bash_profile.template.bash $HOME/.bash_profile - echo "Copied the template .bash_profile into ~/.bash_profile, edit this file to customize bash-it" -while true -do - read -p "Do you use Jekyll? (If you don't know what Jekyll is, answer 'n') [Y/N] " RESP - - case $RESP - in - [yY]) - cp $HOME/.bash_it/template/jekyllconfig.template.bash $HOME/.jekyllconfig - echo "Copied the template .jekyllconfig into your home directory. Edit this file to customize bash-it for using the Jekyll plugins" - break - ;; - [nN]) - break - ;; - *) - echo "Please enter Y or N" - esac -done +if [ -e $HOME/.bash_profile.orig ]; then + while true + do + echo "" + echo "Would you like to append your original .bash_profile (currently .bash_profile.orig) to the bash-it configuration?" + echo "Be advised that therefore you maybe overwrite existing bash-it configurations" + read -p "Append? [y/N]" RESP + case $RESP + in + [yY]) + echo -e "# Load original .bash_profile\nsource $HOME/.bash_profile.orig" >> $HOME/.bash_profile + echo "Appended .bash_profile.orig (your former .bash_profile) to .bash_profile (the current bash-it one)" + break + ;; + "") + ;& + [nN]) + break + ;; + *) + echo "Please enter Y or N" + esac + done +fi function load_all() { file_type=$1 diff --git a/plugins/available/jekyll.plugin.bash b/plugins/available/jekyll.plugin.bash index 6254a87f..2cc99035 100644 --- a/plugins/available/jekyll.plugin.bash +++ b/plugins/available/jekyll.plugin.bash @@ -1,6 +1,15 @@ cite about-plugin about-plugin 'manage your jekyll site' +# Load all the Jekyll stuff + +if [ -e $HOME/.jekyllconfig ] +then + . $HOME/.jekyllconfig +fi + +# functions + editpost() { about 'edit a post' param '1: site directory' diff --git a/template/jekyllconfig.template.bash b/template/jekyllconfig.template.bash deleted file mode 100644 index 291bf85e..00000000 --- a/template/jekyllconfig.template.bash +++ /dev/null @@ -1,21 +0,0 @@ -# This is a space-delimited list of your Jekyll project paths - -SITES="$HOME/sites/project_1 $HOME/sites/project_2" - -# This is another space-delimited list. -# This one is of the remote user@host:path location of your jekyll site -# NOTE: The locations of these must correspond to the locations -# of the sites in the first list -# For instance, the host for the first Jekyll site -# must be first in this list, the second second, etc. - -REMOTES="user@host_1:path user@host_2:path" - -# list of markup syntaxes to use for the sites, -# Same rules as above. Can be HTML, textile, or markdown - -MARKUPS="markdown textile" - -# If you want to use a different editor for Jekyll, change the value of this variable - -JEKYLL_EDITOR="$EDITOR"