feat: auto update repo

This commit is contained in:
max_richter 2021-06-14 10:55:31 +02:00
parent 8fc2eb4ba4
commit ef8e627128
2 changed files with 17 additions and 0 deletions

View File

@ -68,6 +68,8 @@ fi
# For wsl stay in the current dir when splitting panes? # For wsl stay in the current dir when splitting panes?
export PROMPT_COMMAND='printf "\e]9;9;%s\e\\" "$(wslpath -m "$PWD")"' export PROMPT_COMMAND='printf "\e]9;9;%s\e\\" "$(wslpath -m "$PWD")"'
source $HOME/.dotfiles/configs/zsh/update-repo.zsh
# The next line updates PATH for the Google Cloud SDK. # The next line updates PATH for the Google Cloud SDK.
#if [ -f '/home/coder/downloads/google-cloud-sdk/path.zsh.inc' ]; then . '/home/coder/downloads/google-cloud-sdk/path.zsh.inc'; fi #if [ -f '/home/coder/downloads/google-cloud-sdk/path.zsh.inc' ]; then . '/home/coder/downloads/google-cloud-sdk/path.zsh.inc'; fi

View File

@ -0,0 +1,15 @@
if [ -d "~/.dotfiles" ]; then
currentDir=$(pwd)
VN=$(git describe --abbrev=7 HEAD 2>/dev/null)
git update-index -q --refresh
CHANGED=$(git diff-index --name-only HEAD --)
if [ ! -z $CHANGED ]; then
cd ~/.dotfiles
git reset --hard origin/main
git pull origin main
zshu
fi
fi