diff --git a/bootstrap-user.sh b/bootstrap-user.sh new file mode 100755 index 0000000..b266bdf --- /dev/null +++ b/bootstrap-user.sh @@ -0,0 +1,16 @@ +#! /bin/bash +TMPDIR=$(mktemp -u -p "$HOME" -d dotfiles.XXXXX) && \ + git clone --separate-git-dir="$HOME/.cfg" https://github.com/schtobia/dotfiles.git "$TMPDIR" && \ + [ -r "$TMPDIR/.gitmodules" ] && cp -vi "$TMPDIR/.gitmodules" "$HOME" +[ -d "$HOME/.cfg" ] && \ + git --git-dir="$HOME/.cfg/" --work-tree="$HOME" config status.showUntrackedFiles no && \ + (cd $HOME && \ + git --git-dir="$HOME/.cfg/" --work-tree="$HOME" checkout -- . && \ + git --git-dir="$HOME/.cfg/" --work-tree="$HOME" submodule update --init --remote --recursive --rebase) +rm -rf $TMPDIR + +# vim related +pip install --user neovim && \ + npm install -g instant-markdown-d && \ + nvim +PluginInstall +qall && \ + (cd $HOME/.vim/bundle/YouCompleteMe && ./install.py --clang-completer --js-completer --system-libclang) diff --git a/bootstrap.sh b/bootstrap.sh index 4575433..7989430 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,7 +1,4 @@ #! /bin/sh -DISTRO=$(lsb_release -is | tr '[A-Z]' '[a-z]') -SUITE=$(lsb_release -cs) - sudo -S bash -c "apt update && apt dist-upgrade && \ apt install bash-completion locales man mc elinks git zsh curl neovim byobu htop \ command-not-found apt-file apt-transport-https ca-certificates software-properties-common \ @@ -9,17 +6,6 @@ sudo -S bash -c "apt update && apt dist-upgrade && \ apt-file update && \ update-command-not-found" -# clone the entire environment from github -TMPDIR=$(mktemp -u -p "$HOME" -d dotfiles.XXXXX) && \ - git clone --separate-git-dir="$HOME/.cfg" https://github.com/schtobia/dotfiles.git "$TMPDIR" && \ - [ -r "$TMPDIR/.gitmodules" ] && cp -vi "$TMPDIR/.gitmodules" "$HOME" -[ -d "$HOME/.cfg" ] && \ - git --git-dir="$HOME/.cfg/" --work-tree="$HOME" config status.showUntrackedFiles no && \ - (cd $HOME && \ - git --git-dir="$HOME/.cfg/" --work-tree="$HOME" checkout -- . && \ - git --git-dir="$HOME/.cfg/" --work-tree="$HOME" submodule update --init --remote --recursive --rebase) -rm -rf $TMPDIR - # node related curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - sudo apt-get install -y nodejs @@ -31,8 +17,5 @@ sudo -HS bash -c "curl -RLfs https://bootstrap.pypa.io/get-pip.py | python2 && \ # Docker related curl -RLSsf1 https://github.com/schtobia/bootstrap/raw/master/docker-install.sh | sudo -SH bash - -# vim related -pip install --user neovim && \ - npm install -g instant-markdown-d && \ - nvim +PluginInstall +qall && \ - (cd $HOME/.vim/bundle/YouCompleteMe && ./install.py --clang-completer --js-completer --system-libclang) +# userspace stuff +curl -RLSsf1 https://github.com/schtobia/bootstrap/raw/master/bootstrap-user.sh | bash -