Update 2 files: .zshrc, functions.zsh
This commit is contained in:
@@ -12,6 +12,7 @@ source ${ZDOTDIR}/init.zsh
|
|||||||
source ${ZDOTDIR}/aliases.zsh
|
source ${ZDOTDIR}/aliases.zsh
|
||||||
source ${ZDOTDIR}/functions.zsh
|
source ${ZDOTDIR}/functions.zsh
|
||||||
|
|
||||||
|
dotstate_update
|
||||||
|
|
||||||
eval "$(starship init zsh)"
|
eval "$(starship init zsh)"
|
||||||
|
|
||||||
dotstate_update
|
|
||||||
@@ -17,7 +17,8 @@ dotstate_update() {
|
|||||||
|
|
||||||
if [[ -d "$TARGET_DIR/.git" ]]; then
|
if [[ -d "$TARGET_DIR/.git" ]]; then
|
||||||
local remote_sha local_sha
|
local remote_sha local_sha
|
||||||
remote_sha=$(git ls-remote "$REPO_URL" HEAD | awk '{print $1}')
|
remote_sha=$(timeout 5 git ls-remote "$REPO_URL" HEAD | awk '{print $1}')
|
||||||
|
[[ -z "$remote_sha" ]] && return 0
|
||||||
local_sha=$(git -C "$TARGET_DIR" rev-parse HEAD)
|
local_sha=$(git -C "$TARGET_DIR" rev-parse HEAD)
|
||||||
[[ "$remote_sha" == "$local_sha" ]] && return 0
|
[[ "$remote_sha" == "$local_sha" ]] && return 0
|
||||||
info "Repository out of date. Pulling updates..."
|
info "Repository out of date. Pulling updates..."
|
||||||
|
|||||||
Reference in New Issue
Block a user