X-Git-Url: https://arthur.barton.de/gitweb/?p=ax-zsh.git;a=blobdiff_plain;f=bin%2Faxzshctl;h=20ebe115fb4f69b05696a8bfd0ed351dadf7baff;hp=82fb065bd858e69fa01fae5b9709aa30de870270;hb=cd7af750a8cf90353e8d17603469a27cd2ad9677;hpb=ab4280c3ec2f2e99c01bc52775a9a3135bca8ee1 diff --git a/bin/axzshctl b/bin/axzshctl index 82fb065..20ebe11 100755 --- a/bin/axzshctl +++ b/bin/axzshctl @@ -37,6 +37,9 @@ function Usage { echo " enable-default-plugins" echo " Enable all default plugins." echo + echo " upgrade" + echo " Upgrade AX-ZSH installation (requires Git)." + echo exit 2 } @@ -104,6 +107,20 @@ function EnableDefaultPlugins { return $? } +function UpgradeAXZSH { + if [[ $+commands[git] -eq 0 ]]; then + ax_msg 2 "The git(1) command is not available!" + return 1 + fi + if [[ ! -d "$AXZSH/.git" ]]; then + ax_msg 2 "AX-ZSH seems not to be installed using Git. Can't upgrade!" + return 1 + fi + + ax_msg - "Upgrading AX-ZSH in \"$AXZSH\" using git(1) ..." + ( cd "$AXZSH" && git pull --ff-only ) +} + NAME="$(basename "$0")" [[ $# -gt 0 ]] || Usage @@ -138,6 +155,10 @@ case "$cmd" in [[ $# -eq 0 ]] || Usage EnableDefaultPlugins ;; + "upgrade") + [[ $# -eq 0 ]] || Usage + UpgradeAXZSH + ;; *) Usage esac