From a774c347e9718fb0c2ffb06a48925a99707f7704 Mon Sep 17 00:00:00 2001 From: Tobias Schmidl Date: Fri, 2 Nov 2018 11:39:41 +0100 Subject: [PATCH] Reworked the dotfiles part --- bootstrap.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 2c60383..243f93a 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -10,12 +10,15 @@ sudo -S bash -c "apt update && apt dist-upgrade && \ 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" -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 -r $TMPDIR +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 -