diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-03-31 11:51:43 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-03-31 11:51:43 +0200 |
| commit | 10d80f8d2858de6da4a73073e3f68dfd269d6cff (patch) | |
| tree | 7aa317579fad898ccef8b8c2ff69bff511c7f985 | |
| parent | 6cb4a877a2e9a59c3c17d477333840e5ae13ed82 (diff) | |
| download | dotfiles-10d80f8d2858de6da4a73073e3f68dfd269d6cff.tar.gz dotfiles-10d80f8d2858de6da4a73073e3f68dfd269d6cff.tar.bz2 dotfiles-10d80f8d2858de6da4a73073e3f68dfd269d6cff.zip | |
Install script refactoring
| -rwxr-xr-x | install.sh | 45 |
1 files changed, 30 insertions, 15 deletions
@@ -1,5 +1,16 @@ #!/bin/sh +create_dotfile_link() +{ + ln -sf $DOTDIR/$1 $HOME/$2 + echo "Created link for $1 to $HOME/$2" +} + +create_dotfile_link_same() +{ + create_dotfile_link $1 $1 +} + ########################### # dotfiles install script # ########################### @@ -8,44 +19,48 @@ [ -z $DOTDIR ] && DOTDIR=`pwd` # Creating links -ln -sf $DOTDIR/.zshrc $HOME/.zshrc -ln -sf $DOTDIR/.vimrc $HOME/.vimrc +create_dotfile_link_same .zshrc +create_dotfile_link_same .bashrc +create_dotfile_link_same .vimrc [ ! -d $HOME/.vim/plugin ] && mkdir -p $HOME/.vim/plugin -ln -sf $DOTDIR/grep.vim $HOME/.vim/plugin/grep.vim +create_dotfile_link grep.vim .vim/plugin/grep.vim [ ! -d $HOME/.xmonad ] && mkdir $HOME/.xmonad -ln -sf $DOTDIR/xmonad.hs $HOME/.xmonad/xmonad.hs +create_dotfile_link xmonad.hs .xmonad/xmonad.hs -ln -sf $DOTDIR/.gdbinit $HOME/.gdbinit -ln -sf $DOTDIR/.ghci $HOME/.ghci -ln -sf $DOTDIR/.gitconfig $HOME/.gitconfig +create_dotfile_link_same .gdbinit +create_dotfile_link_same .ghci +create_dotfile_link_same .gitconfig [ ! -d $HOME/.config ] && mkdir $HOME/.config -ln -sf $DOTDIR/redshift.conf $HOME/.config/redshift.conf +create_dotfile_link redshift.conf .config/redshift.conf ################ # dependencies # ################ +[ $# -ge 1 ] || [ "$1" = "--ln" ] && exit 0 +echo "Installing Dependencies" + # vim Plug PLUGFILE=$HOME/.vim/autoload/plug.vim -if [ ! -f $PLUGFILE ]; then -curl -fLo $PLUGFILE --create-dirs \ - https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -fi +PLUGURL='https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' +[ ! -f $PLUGFILE ] && echo "Downloading plug.vim" && \ + curl -fLo $PLUGFILE --create-dirs $PLUGURL +echo "Installing plug.vim Pluggins" vim -c "PlugInstall" -c "qa" # zsh pluggins [ ! -d $HOME/.zsh ] && make $HOME/.zsh # pure theme -[ ! -d $HOME/.zsh/pure ] && \ +[ ! -d $HOME/.zsh/pure ] && echo "Installing zsh pure theme" && \ git clone https://github.com/sindresorhus/pure \ $HOME/.zsh/pure # syntax hightlighting -[ ! -d $HOME/.zsh/zsh-syntax-highlighting ] && \ +[ ! -d $HOME/.zsh/zsh-syntax-highlighting ] && echo "Installing zsh syntax highlighting plugin" && \ git clone https://github.com/zsh-users/zsh-syntax-highlighting \ $HOME/.zsh/zsh-syntax-highlighting # you should use -[ ! -d $HOME/.zsh/zsh-you-should-use ] && \ +[ ! -d $HOME/.zsh/zsh-you-should-use ] && echo "Installing zsh you should use plugin" && \ git clone https://github.com/MichaelAquilina/zsh-you-should-use \ $HOME/.zsh/zsh-you-should-use |
