X-Git-Url: https://arthur.barton.de/gitweb/?p=ax-zsh.git;a=blobdiff_plain;f=bin%2Faxzshctl;h=5b2be804703606103721a44cedb0ded329d375a5;hp=32dd61a17577e83fd33f79faf33f235263eac478;hb=8eea5840d8c5fc594764e37664effe592b4f18c5;hpb=1b3bf551cb606722ebd80a8693e377d4caaf2107 diff --git a/bin/axzshctl b/bin/axzshctl index 32dd61a..5b2be80 100755 --- a/bin/axzshctl +++ b/bin/axzshctl @@ -107,13 +107,18 @@ function EnablePlugin { # GitHub plugin mkdir -p "$AXZSH/repos" if [[ ! -e "$AXZSH/repos/$plugin" ]]; then - ax_msg - "Cloning plugin from GitHub ..." - git clone "https://github.com/$1.git" \ + ax_msg - "Cloning module from GitHub ..." + git clone --depth=1 "https://github.com/$1.git" \ "$AXZSH/repos/$plugin" - # Try to enable a theme in this "foreign" plugin, but - # ignore errors: we don't know if this plugin provides - # a theme at all ... - SetTheme "${plugin#*#}" 2>/dev/null + fi + # Try to enable a theme in this "foreign module", but ignore + # errors: we don't know if this module provides a theme or is + # a "regular" plugin ... + if SetTheme "${plugin#*#}" 2>/dev/null; then + ax_msg 0 "Module \"$1\" was enabled as theme \"${plugin#*#}\"." + # A theme was enabled: So assume that this is a theme + # and don't enable it as plugin. + return 0 fi fi @@ -380,7 +385,7 @@ case "$cmd" in ;; "set-theme") [[ $# -eq 1 ]] || Usage - SetTheme "$1" && UpdatePluginCache + SetTheme "$1" ;; "upgrade") [[ $# -eq 0 ]] || Usage