Use placeholder to call git with the dotfiles-configuration during setup

This commit is contained in:
2022-11-21 16:34:09 +00:00
parent 454400d14b
commit 1687e6649c

View File

@@ -36,17 +36,18 @@ unset _osname
# clone dotfiles for fast startup # clone dotfiles for fast startup
GIT_DIR=$HOME/Development/nemoinho/gitea.nehrke.info/nemoinho/dotfiles GIT_DIR=$HOME/Development/nemoinho/gitea.nehrke.info/nemoinho/dotfiles
config='/usr/bin/git --git-dir '"$GIT_DIR"' --work-tree '"$HOME"''
if [ ! -d "$GIT_DIR" ] if [ ! -d "$GIT_DIR" ]
then then
GIT_REMOTE=git@gitea.nehrke.info:nemoinho/dotfiles.git GIT_REMOTE=git@gitea.nehrke.info:nemoinho/dotfiles.git
git clone --separate-git-dir=$GIT_DIR $GIT_REMOTE $HOME/tmp-dotfiles git clone --separate-git-dir=$GIT_DIR $GIT_REMOTE $HOME/tmp-dotfiles
rm -r ~/tmp-dotfiles rm -r ~/tmp-dotfiles
else else
/usr/bin/git --git-dir "$GIT_DIR" --work-tree "$HOME" pull $config pull
fi fi
alias config='/usr/bin/git --git-dir=$GIT_DIR --work-tree=$HOME' alias config="$config"
config config --local status.showUntrackedFiles no $config config --local status.showUntrackedFiles no
config checkout $config checkout
# reload bash_profile to configure the current shell with the just installed dotfiles # reload bash_profile to configure the current shell with the just installed dotfiles
. ~/.bash_profile . ~/.bash_profile