diff --git a/antigen.zsh b/antigen.zsh index 1e4155b..c71d4d1 100644 --- a/antigen.zsh +++ b/antigen.zsh @@ -49,6 +49,11 @@ antigen-bundle () { make_local_clone=false fi + # Add the theme extension to `loc`, if this is a theme. + if [[ $btype == theme && $loc != *.zsh-theme ]]; then + loc="$loc.zsh-theme" + fi + # Add it to the record. _ANTIGEN_BUNDLE_RECORD="$_ANTIGEN_BUNDLE_RECORD\n$url $loc $btype" _ANTIGEN_BUNDLE_RECORD="$_ANTIGEN_BUNDLE_RECORD $make_local_clone" @@ -313,8 +318,18 @@ antigen-lib () { } antigen-theme () { - local name="${1:-robbyrussell}" - antigen-bundle --loc=themes/$name.zsh-theme --btype=theme + + if [[ "$1" != */* && "$1" != --* ]]; then + # The first argument is just a name of the plugin, to be picked up from + # the default repo. + local name="${1:-robbyrussell}" + antigen-bundle --loc=themes/$name --btype=theme + + else + antigen-bundle "$@" --btype=theme + + fi + } antigen-apply () { diff --git a/tests/.zshenv b/tests/.zshenv index e5e494f..d942446 100644 --- a/tests/.zshenv +++ b/tests/.zshenv @@ -17,6 +17,7 @@ mkdir "$PLUGIN_DIR" alias pg='git --git-dir "$PLUGIN_DIR/.git" --work-tree "$PLUGIN_DIR"' echo 'alias hehe="echo hehe"' > "$PLUGIN_DIR"/aliases.zsh +echo 'export PS1="prompt>"' > "$PLUGIN_DIR"/silly.zsh-theme { pg init diff --git a/tests/theme.t b/tests/theme.t new file mode 100644 index 0000000..f8f7ac3 --- /dev/null +++ b/tests/theme.t @@ -0,0 +1,7 @@ +Load the theme explicitly. + + $ antigen-theme $PLUGIN_DIR silly + Cloning into '*'... (glob) + done. + $ echo "$PS1" + prompt>