feat: auto update repo
This commit is contained in:
parent
8fc2eb4ba4
commit
ef8e627128
@ -68,6 +68,8 @@ fi
|
||||
# For wsl stay in the current dir when splitting panes?
|
||||
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.
|
||||
#if [ -f '/home/coder/downloads/google-cloud-sdk/path.zsh.inc' ]; then . '/home/coder/downloads/google-cloud-sdk/path.zsh.inc'; fi
|
||||
|
||||
|
15
configs/zsh/update-repo.zsh
Normal file
15
configs/zsh/update-repo.zsh
Normal 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
|
Loading…
Reference in New Issue
Block a user