Make dots script complain when more stuff goes wrong

This commit is contained in:
Danielle McLean 2023-10-16 14:49:06 +11:00
parent dc3d59b4a4
commit bbfca281e7
Signed by: 00dani
GPG key ID: 52C059C3B22A753E

View file

@ -82,7 +82,7 @@ fetch() {
(( $#packages == 0 )) && packages=( $DOTFILES/*(N:t) ) (( $#packages == 0 )) && packages=( $DOTFILES/*(N:t) )
for p in $packages; do for p in $packages; do
cd $DOTFILES/$p cd $DOTFILES/$p
git fetch -p git fetch -p || return $?
done done
} }
@ -92,7 +92,7 @@ pull() {
(( $#packages == 0 )) && packages=( $DOTFILES/*(N:t) ) (( $#packages == 0 )) && packages=( $DOTFILES/*(N:t) )
for p in $packages; do for p in $packages; do
cd $DOTFILES/$p cd $DOTFILES/$p
git pull git pull || return $?
done done
} }
@ -157,8 +157,9 @@ main() {
link) link ${argv[2,-1]} ;; link) link ${argv[2,-1]} ;;
pull) pull ${argv[2,-1]} ;; pull) pull ${argv[2,-1]} ;;
st|status) status ${argv[2,-1]} ;; st|status) status ${argv[2,-1]} ;;
*) echo "Unknown subcommand $comm" >&2; return 2 ;;
esac esac
} }
main "$@" main "$@"
} # Wrap the entire program in a braced block so it won't run at all if you do curl | zsh and the connection drops. }