diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-08-10 02:50:57 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-08-10 02:50:57 +0200 |
| commit | c9a38b22e7b5ea507352a170fd4cf3ea73acc2cd (patch) | |
| tree | 2e53a8a0c152018c31abd89f59afd2583e8d9d33 /install | |
| parent | b886c364aca56c684d91a2e6e9c823a50c8b692f (diff) | |
| download | dotfiles-c9a38b22e7b5ea507352a170fd4cf3ea73acc2cd.tar.gz dotfiles-c9a38b22e7b5ea507352a170fd4cf3ea73acc2cd.tar.bz2 dotfiles-c9a38b22e7b5ea507352a170fd4cf3ea73acc2cd.zip | |
Added repo clone in project-open, cleaning installation script
Diffstat (limited to 'install')
| -rwxr-xr-x | install | 75 |
1 files changed, 45 insertions, 30 deletions
@@ -2,30 +2,30 @@ create_dotfile_link() { - ln -svf $DOTDIR/$1 $HOME/$2 + ln -svf "$DOTDIR/$1" "$HOME/$2" } create_dotfile_link_same() { - create_dotfile_link $1 $1 + create_dotfile_link "$1" "$1" } -########################### -# dotfiles install script # -########################### +############################################################################### +# link dotfiles +############################################################################### # dotfiles directory -[ -z $DOTDIR ] && export DOTDIR=`pwd` +[ -z "$DOTDIR" ] && DOTDIR=$(pwd) && export DOTDIR # Creating links create_dotfile_link_same .zshrc create_dotfile_link_same .bashrc create_dotfile_link_same .vimrc create_dotfile_link_same .pluggins.vim -[ ! -d $HOME/.vim/plugin ] && mkdir -p $HOME/.vim/plugin +mkdir -p "$HOME/.vim/plugin" create_dotfile_link grep.vim .vim/plugin/grep.vim -[ ! -d $HOME/.xmonad ] && mkdir $HOME/.xmonad +mkdir -p "$HOME/.xmonad" create_dotfile_link xmonad.hs .xmonad/xmonad.hs create_dotfile_link_same .gdbinit @@ -36,37 +36,52 @@ create_dotfile_link_same .mailcap create_dotfile_link_same .xinitrc create_dotfile_link_same .zprofile -[ ! -d $HOME/.config ] && mkdir $HOME/.config +mkdir -p "$HOME/.config" create_dotfile_link redshift.conf .config/redshift.conf -create_dotfile_link_same slock/config.def.h +mkdir -p "$HOME/.config/dunst" +create_dotfile_link dunst/dunstrc .config/dunst/dunstrc -################ -# dependencies # -################ +mkdir -p "$HOME/.newsboat" +create_dotfile_link_same .newsboat/config -[ $# -ge 1 ] || [ "$1" = "--ln" ] && exit 0 +# create_dotfile_link_same slock/config.def.h + + +############################################################################### +# dependencies +############################################################################### + +[ "$#" -ne 1 ] || [ ! "$1" = "-a" ] && exit 0 echo "Installing Dependencies" +############################################################################### # vim Plug -PLUGFILE=$HOME/.vim/autoload/plug.vim +PLUGFILE="$HOME/.vim/autoload/plug.vim" PLUGURL='https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' -[ ! -f $PLUGFILE ] && echo "Downloading plug.vim" && \ - curl -fLo $PLUGFILE --create-dirs $PLUGURL +[ ! -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 ] && echo "Installing zsh pure theme" && \ - git clone https://github.com/sindresorhus/pure \ - $HOME/.zsh/pure -# syntax hightlighting -[ ! -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 ] && echo "Installing zsh you should use plugin" && \ - git clone https://github.com/MichaelAquilina/zsh-you-should-use \ - $HOME/.zsh/zsh-you-should-use + +update_plugin() +{ + url="$1" + dest_path="$2" + if [ ! -d "$dest_path" ] + then + echo "Installing $dest_path" + git clone "$url" "$dest_path" + else + echo "Updating $dest_path" + git -C "$dest_path" pull + fi +} + +mkdir -p "$HOME/.zsh" +update_plugin 'https://github.com/sindresorhus/pure' "$HOME/.zsh/pure" +update_plugin 'https://github.com/zsh-users/zsh-syntax-highlighting' "$HOME/.zsh/zsh-syntax-highlighting" +update_plugin 'https://github.com/MichaelAquilina/zsh-you-should-use' "$HOME/.zsh/zsh-you-should-use" |
