remove zwc files, add gitfetch function

Also load modules for stat and time;
Fix status typos
This commit is contained in:
Andrea Mistrali 2021-12-16 08:54:17 +01:00
parent f89f77715c
commit ca8a24d28e
No known key found for this signature in database
GPG Key ID: 6FB0A77F6D5DA9B2
8 changed files with 26 additions and 2 deletions

View File

@ -1,6 +1,14 @@
####################################################################################### #######################################################################################
# Functions # Functions
# #
#
#
#
# Load usefule modules
zmodload -F zsh/stat b:zstat
zmodload zsh/datetime
#
# Autoload all functions in zshfunctions # Autoload all functions in zshfunctions
# #
autoload -U $LIBRARY/zshfunctions/*(.:t) autoload -U $LIBRARY/zshfunctions/*(.:t)

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,16 @@
zmodload -F zsh/stat b:zstat
zmodload zsh/datetime
local _gitdir
local last_fetch
local diff
cd $1
_gitdir=$(git rev-parse --git-dir 2> /dev/null) || return 0
last_fetch=$(zstat +mtime $_gitdir/FETCH_HEAD 2> /dev/null || echo 0)
let "diff = $(strftime %s)- $last_fetch"
[ $diff -gt ${GIT_FETCH_INTERVAL:-30} ] && git fetch --all -p
return 0
# vim: set ts=2 sw=2 tw=0 ft=sh :

View File

@ -16,9 +16,9 @@ echo
if [ $HOMEBREW_PREFIX ]; then if [ $HOMEBREW_PREFIX ]; then
print -P "$FX[bold]Homebrew enabled: $FG[002]yes$FX[reset]" print -P "$FX[bold]Homebrew enabled: $FG[002]yes$FX[reset]"
print -P "H$FX[bold]omebrew prefix: $FG[002]$HOMEBREW_PREFIX$FX[reset]" print -P "$FX[bold]Homebrew prefix: $FG[002]$HOMEBREW_PREFIX$FX[reset]"
else else
print -P "H$FX[bold]omebrew enabled: $FG[001]no$FX[reset]" print -P "$FX[bold]Homebrew enabled: $FG[001]no$FX[reset]"
fi fi
print -nP "\n$FX[bold]iTerm2 integration: " print -nP "\n$FX[bold]iTerm2 integration: "

Binary file not shown.

Binary file not shown.