Add a dots pull command which just git pulls in every package

This commit is contained in:
Danielle McLean 2016-10-30 10:17:24 +11:00
parent 71601dacf1
commit cd3c23e76b
No known key found for this signature in database
GPG key ID: CC91589719027E94
2 changed files with 14 additions and 1 deletions

View file

@ -10,6 +10,7 @@ commands=(
clone:'download dotfiles packages over Git' clone:'download dotfiles packages over Git'
fetch:'retrieve updates to your packages' fetch:'retrieve updates to your packages'
link:'install downloaded packages into your ~' link:'install downloaded packages into your ~'
pull:'fetch and apply package updates'
status:'check whether your packages have changes' status:'check whether your packages have changes'
) )
if ! _retrieve_cache dots-repositories; then if ! _retrieve_cache dots-repositories; then
@ -29,6 +30,6 @@ case $state in
else else
_message 'all known packages are already installed, you can still enter a git url manually' _message 'all known packages are already installed, you can still enter a git url manually'
fi ;; fi ;;
fetch|link|st|status) _values -w package $DOTFILES/*(/:t) ;; fetch|link|pull|st|status) _values -w package $DOTFILES/*(/:t) ;;
esac ;; esac ;;
esac esac

View file

@ -75,6 +75,17 @@
done done
} }
'pull'() {
local -a packages
packages=($argv)
(( $#packages == 0 )) && packages=( $DOTFILES/*(N:t) )
for p in $packages; do
cd $DOTFILES/$p
git pull
done
}
'status'() { 'status'() {
local -a packages local -a packages
packages=($argv) packages=($argv)
@ -132,5 +143,6 @@ case $comm in
clone) clone ${argv[2,-1]} ;; clone) clone ${argv[2,-1]} ;;
fetch) fetch ${argv[2,-1]} ;; fetch) fetch ${argv[2,-1]} ;;
link) link ${argv[2,-1]} ;; link) link ${argv[2,-1]} ;;
pull) pull ${argv[2,-1]} ;;
st|status) status ${argv[2,-1]} ;; st|status) status ${argv[2,-1]} ;;
esac esac