diff options
-rwxr-xr-x | install | 50 | ||||
-rw-r--r-- | utils/inst | 17 |
2 files changed, 42 insertions, 25 deletions
@@ -7,26 +7,34 @@ git submodule update --init || (echo "Submodule update failed!"; exit 5) # Source inst and diff function . ./utils/inst -################################################################################# -source private/install # private files, sorry but some privacy is required. - -echo -ne "\e[1;34mInstall Bashrc\e[0m" -inst bashrc ~/.bashrc -inst shellrc ~/.shellrc -inst profile ~/.profile - -echo -ne "\e[1;34mInstall zshrc\e[0m" -inst zshrc ~/.zshrc -inst zprofile ~/.zprofile +# Load if we force changes (implies no interaction) +[ "$1" = "-f" ] && FORCE=true || FORCE=false -echo -ne "\e[1;34mInstall GIT configuration\e[0m" -inst gitconfig ~/.gitconfig -inst local/git-prompt.sh ~/.local/ - -echo -ne "\e[1;34mInstall configurations for various utility tools\e[0m" -inst screenrc ~/.screenrc +################################################################################# -echo -ne "\e[1;34mInstall vim scripts\e[0m" -inst vimrc ~/.vimrc -mkdir -p ~/.cache/vim # directory for *.swp files -mkdir -p ~/.cache/vim-undo # directory for undo files +if ask "Install Bashrc"; then + inst bashrc ~/.bashrc + inst shellrc ~/.shellrc + inst profile ~/.profile +fi + +if ask "Install zshrc"; then + inst zshrc ~/.zshrc + inst shellrc ~/.shellrc + inst zprofile ~/.zprofile +fi + +if ask "Install GIT configuration"; then + inst gitconfig ~/.gitconfig + inst local/git-prompt.sh ~/.local/ +fi + +if ask "Install configurations for various utility tools"; then + inst screenrc ~/.screenrc +fi + +if ask "Install vim scripts"; then + inst vimrc ~/.vimrc + mkdir -p ~/.cache/vim # directory for *.swp files + mkdir -p ~/.cache/vim-undo # directory for undo files +fi @@ -2,9 +2,14 @@ # vim: ft=sh ask() { - echo -ne "\e[1;34m$1 (Y/n) \e[0m" - read - [[ $REPLY =~ ^[Yy]?$ ]] + if $FORCE; then + echo -ne "\e[1;34m$1\e[0m" + # Fall trough with 0 exit (always yes) + else + echo -ne "\e[1;34m$1? (Y/n) \e[0m" + read + [[ $REPLY =~ ^[Yy]?$ ]] + fi } dodiff() { @@ -25,7 +30,11 @@ dodiff() { echo -e "\e[1;32mNo difference detected:\e[0m $OUT" return fi - vimdiff "$1" "$OUT" + if $FORCE; then + doinst "$1" "$OUT" + else + vimdiff "$1" "$OUT" + fi } checkdiff() { |