diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 25881f1..1ad414c 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.9.6 +current_version = 1.9.7 parse = v?(?P\d+)\.(?P\d+)\.(?P\d+) serialize = {major}.{minor}.{revision} @@ -9,6 +9,8 @@ serialize = {major}.{minor}.{revision} [bumpversion:file:tests/test_antidote.md] +[bumpversion:file:tests/test_antidote_core.md] + [bumpversion:file:tests/test_cmd_update.md] [bumpversion:file:README.md] diff --git a/.gitignore b/.gitignore index 97fa322..7b4d121 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *.zwc *.zwc.old .cache/ +!/tests/**/.cache/ .tmp/ .plugins/ .todo/ diff --git a/README.md b/README.md index 7954adf..eea62f1 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # antidote [![MIT License](https://img.shields.io/badge/license-MIT-007EC7.svg)](/LICENSE) -![version](https://img.shields.io/badge/version-v1.9.6-df5e88) +![version](https://img.shields.io/badge/version-v1.9.7-df5e88) [Get the cure][getantidote] -[Antidote][getantidote] is a feature-complete Zsh implementation of the legacy [Antibody][antibody] plugin manager, which in turn was derived from [Antigen][antigen]. Antidote not only aims to provide continuity for those legacy plugin managers, but also to delight new users with high-performance, easy-to-use Zsh plugin management. +[Antidote][getantidote] is a feature-complete Zsh implementation of the legacy +[Antibody][antibody] plugin manager, which in turn was derived from [Antigen][antigen]. +Antidote not only aims to provide continuity for those legacy plugin managers, but also +to delight new users with high-performance, easy-to-use Zsh plugin management. ## NOTICE -**The planned upcoming 2.0 release will stop defaulting to compatibility with antibody.** If maintaining compatibility with antibody is important to you, you can ensure that your config remains compatible by add the following `zstyle` to your config **now**, before the 2.0 release goes live: +**The planned upcoming 2.0 release will stop defaulting to compatibility with +antibody.** If maintaining compatibility with antibody is important to you, you can +ensure that your config remains compatible by add the following `zstyle` to your config +**now**, before the 2.0 release goes live: ```zsh -zstyle ':antidote:compatibility-mode' 'antibody' +zstyle ':antidote:compatibility-mode' 'antibody' 'on' ``` -Breaking compatibility by default will allow antidote to continue to grow and gain new features, as well as fix some long-standing issues that have always been present in antibody, for example: - -- In 2.0, `fpath` can be fully set at the beginning of your bundles in you static file, making setting up completion bundles properly way easier and less frustrating ([#74](https://github.com/mattmc3/antidote/discussions/74), [#144](https://github.com/mattmc3/antidote/issues/144)). -- bundles will no longer default to using fugly directory names ($ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar), making `zstyle ':antidote:bundle' use-friendly-names on` obsolete. +Breaking compatibility by default will allow antidote to continue to grow and gain new +features, as well as fix some long-standing issues that have always been present in +antibody, for example: + +- In 2.0, `fpath` can be fully set at the beginning of your bundles in you static file, + making setting up completion bundles properly way easier and less frustrating + ([#74](https://github.com/mattmc3/antidote/discussions/74), + [#144](https://github.com/mattmc3/antidote/issues/144)). +- bundles will no longer default to using fugly directory names + ($ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar), making + `zstyle ':antidote:bundle' use-friendly-names on` obsolete. - probably some other minor deviations as well -Just to be clear, if you don't specifically care about backwards compatibility with antibody, you do not need to change a thing. 2.x will not break your 1.x antidote config. If you do care, be sure to add the compatibility mode `zstyle` above to your config **now**, before the 2.0 release. +Just to be clear, if you don't specifically care about backwards compatibility with +antibody, you do not need to change a thing. 2.x will not break your 1.x antidote +config. If you do care, be sure to add the compatibility mode `zstyle` above to your +config **now**, before the 2.0 release. ## Usage -Basic usage should look really familiar to you if you have used Antibody or Antigen. Bundles (aka: Zsh plugins) are stored in a file typically called `.zsh_plugins.txt`. +Basic usage should look really familiar to you if you have used Antibody or Antigen. +Bundles (aka: Zsh plugins) are stored in a file typically called `.zsh_plugins.txt`. ```zsh # .zsh_plugins.txt @@ -63,7 +80,10 @@ The full documentation can be found at [https://getantidote.github.io][getantido ## Help getting started -If you want to see a full-featured example Zsh configuration using antidote, you can have a look at this [example zdotdir](https://github.com/getantidote/zdotdir) project. Feel free to incorporate code or plugins from it into your own dotfiles, or you can fork it to get started building your own Zsh config from scratch driven by antidote. +If you want to see a full-featured example Zsh configuration using antidote, you can +have a look at this [example zdotdir](https://github.com/getantidote/zdotdir) project. +Feel free to incorporate code or plugins from it into your own dotfiles, or you can fork +it to get started building your own Zsh config from scratch driven by antidote. ## Installation @@ -130,7 +150,7 @@ antidote install https://bitbucket.org/bb_user/bb_repo ## Credits -A big thank you to [Carlos](https://twitter.com/caarlos0) for all his work on +A big thank you to [Carlos](https://github.com/caarlos0) for all his work on [antibody] over the years. [antigen]: https://github.com/zsh-users/antigen diff --git a/functions/__antidote_bulk_clone b/functions/__antidote_bulk_clone index ba6292e..cf86835 100644 --- a/functions/__antidote_bulk_clone +++ b/functions/__antidote_bulk_clone @@ -4,8 +4,13 @@ #function __antidote_bulk_clone { emulate -L zsh; setopt local_options $_adote_funcopts + # Allow the user to define zsh-defer repo in case they want to fork it. + local zsh_defer_bundle + zstyle -s ':antidote:defer' bundle 'zsh_defer_bundle' \ + || zsh_defer_bundle='romkatv/zsh-defer' + # get a list of clonable repos from a bundle file - $__adote_awkcmd ' + $__adote_awkcmd -v ZSH_DEFER_BUNDLE=$zsh_defer_bundle ' BEGIN { RS="[\r\n]" } # initialize vars @@ -15,7 +20,7 @@ /^ *(#.+)?$/ { next } # clone zsh-defer - /kind:defer/ { print "antidote-script --kind clone romkatv/zsh-defer &" } + /kind:defer/ { print "antidote-script --kind clone " ZSH_DEFER_BUNDLE " &" } # handle user/repo and URL forms $1~/^[^\/]+\/[^\/]+$/ { bundle=$1 } diff --git a/functions/__antidote_del b/functions/__antidote_del new file mode 100644 index 0000000..d139c2e --- /dev/null +++ b/functions/__antidote_del @@ -0,0 +1,32 @@ +#!/bin/zsh +# Call me paranoid, but I want to be really certain antidote will never rm something it +# shouldn't. This function wraps rm to double check that any paths being removed are +# valid. If it's not in your $HOME or $TMPDIR, we need to block it. + +#function __antidote_del { + emulate -L zsh; setopt local_options + + local -a rmflags rmpaths + local p + + while (( $# )); do + case "$1" in + --) shift; break ;; + -*) rmflags+=($1) ;; + *) break ;; + esac + shift + done + + (( $# > 0 )) || return 1 + + for p in $@; do + p="${p:a}" + if [[ "$p" != $HOME/* ]] && [[ "$p" != ${TMPDIR:-/tmp}/* ]]; then + print -ru2 -- "antidote: Blocked attempt to rm path: '$p'." + return 1 + fi + done + + command rm ${rmflags[@]} -- "$@" +#} diff --git a/functions/__antidote_load_prep b/functions/__antidote_load_prep index 48a5ee8..a25b1f8 100644 --- a/functions/__antidote_load_prep +++ b/functions/__antidote_load_prep @@ -49,7 +49,7 @@ if [[ ! $staticfile -nt $bundlefile ]] || [[ $force_bundle -eq 1 ]]; then antidote bundle <"$bundlefile" >|"$staticfile" if [[ -r "${staticfile}.zwc" ]] && ! zstyle -t ':antidote:static' zcompile; then - command rm -f -- "${staticfile}.zwc" + __antidote_del -f -- "${staticfile}.zwc" fi fi diff --git a/functions/__antidote_print_path b/functions/__antidote_print_path new file mode 100644 index 0000000..9bce65b --- /dev/null +++ b/functions/__antidote_print_path @@ -0,0 +1,8 @@ +#!/bin/zsh +### Pretty print a path + +if zstyle -t ':antidote:compatibility-mode' 'antibody'; then + echo "$1" +else + echo "$1" | sed -e "s|^$HOME/|\$HOME/|" +fi diff --git a/functions/__antidote_version b/functions/__antidote_version index 681fc77..c24bfd3 100644 --- a/functions/__antidote_version +++ b/functions/__antidote_version @@ -4,7 +4,7 @@ #function __antidote_version { emulate -L zsh; setopt local_options $_adote_funcopts 0=${(%):-%x} - local ver='1.9.6' + local ver='1.9.7' local gitsha=$(git -C "${0:A:h:h}" rev-parse --short HEAD 2>/dev/null) [[ -z "$gitsha" ]] || ver="$ver ($gitsha)" print "antidote version $ver" diff --git a/functions/antidote-purge b/functions/antidote-purge index c4d16c0..70011f4 100644 --- a/functions/antidote-purge +++ b/functions/antidote-purge @@ -38,7 +38,7 @@ } [[ ${REPLY:u} == "Y" ]] || return 1 # remove antidote home and static cache file - command rm -rf -- "$antidote_home" + __antidote_del -rf -- "$antidote_home" if [[ -e "${bundlefile:r}.zsh" ]]; then zstyle -s ':antidote:purge:all' answer 'REPLY' || { @@ -47,7 +47,7 @@ } if [[ ${REPLY:u} == "Y" ]]; then local dtstmp=$(date -u '+%Y%m%d_%H%M%S') - mv -f "${bundlefile:r}.zsh" "${bundlefile:r}.${dtstmp}.bak" + command mv -f "${bundlefile:r}.zsh" "${bundlefile:r}.${dtstmp}.bak" print "'"${bundlefile:r}.zsh"' backed up to '${bundlefile:t:r}.${dtstmp}.bak'" fi fi @@ -68,14 +68,14 @@ fi # remove - command rm -rf "$bundledir" + __antidote_del -rf "$bundledir" print "Removed '$bundle'." # attempt to comment out the bundle from .zsh_plugins.txt if [[ -e "$bundlefile" ]]; then local tmpfile="${bundlefile}.antidote.tmp" $__adote_awkcmd -v pat="$bundle" '$0~"^[[:blank:]]*"pat{print "# " $0;next}1' <$bundlefile >|$tmpfile - mv -f "$tmpfile" "$bundlefile" || rm -f "$tmpfile" + command mv -f "$tmpfile" "$bundlefile" || __antidote_del -f "$tmpfile" print "Bundle '$bundle' was commented out in '$bundlefile'." fi fi diff --git a/functions/antidote-script b/functions/antidote-script index 410aac6..a9832c1 100644 --- a/functions/antidote-script +++ b/functions/antidote-script @@ -53,6 +53,13 @@ print -ru2 "antidote: error: unexpected kind value: '$o_kind[-1]'" && return 1 fi + # If no fpath_rule is set, use the zstyle + if ! (( $#o_fpath_rule )); then + local zstyle_fpath_rule + zstyle -s ':antidote:fpath' rule 'zstyle_fpath_rule' + [[ -z "$zstyle_fpath_rule" ]] || o_fpath_rule=($zstyle_fpath_rule) + fi + local supported_fpath_rules=(append prepend) if ! (( $supported_fpath_rules[(Ie)$o_fpath_rule[-1]] )); then print -ru2 "antidote: error: unexpected fpath rule: '$o_fpath_rule[-1]'" && return 1 @@ -107,32 +114,39 @@ # handle defers local source_cmd="source" + local zsh_defer_bundle + zstyle -s ':antidote:defer' bundle 'zsh_defer_bundle' \ + || zsh_defer_bundle='romkatv/zsh-defer' if [[ "$o_kind[-1]" == "defer" ]]; then source_cmd="${zsh_defer} source" script+=( 'if ! (( $+functions[zsh-defer] )); then' - "$(antidote-script 'romkatv/zsh-defer' | __antidote_indent)" + "$(antidote-script $zsh_defer_bundle | __antidote_indent)" 'fi' ) fi + # Let's make the path a little nicer to deal with + local print_bundle_path="$(__antidote_print_path "$bundle_path")" + # handle autoloading before sourcing if (( $#o_autoload )); then if [[ "$o_fpath_rule[-1]" == prepend ]]; then - script+=("fpath=( ${bundle_path}/${o_autoload[-1]} \$fpath )") + script+=("fpath=( ${print_bundle_path}/${o_autoload[-1]} \$fpath )") + script+=("builtin autoload -Uz \$fpath[1]/*(N.:t)") else - script+=("fpath+=( ${bundle_path}/${o_autoload[-1]} )") + script+=("fpath+=( ${print_bundle_path}/${o_autoload[-1]} )") + script+=("builtin autoload -Uz \$fpath[-1]/*(N.:t)") fi - script+=( "builtin autoload -Uz \$fpath[-1]/*(N.:t)" ) fi # generate load script bundle_type="$(__antidote_bundle_type $bundle_path)" local fpath_script if [[ "$o_fpath_rule[-1]" == prepend ]]; then - fpath_script="fpath=( $bundle_path \$fpath )" + fpath_script="fpath=( $print_bundle_path \$fpath )" else - fpath_script="fpath+=( $bundle_path )" + fpath_script="fpath+=( $print_bundle_path )" fi if [[ "$o_kind[-1]" == fpath ]]; then @@ -140,30 +154,38 @@ script+="$fpath_script" elif [[ "$o_kind[-1]" == path ]]; then # path - script+="export PATH=\"$bundle_path:\$PATH\"" + script+="export PATH=\"$print_bundle_path:\$PATH\"" elif [[ "$o_kind[-1]" == autoload ]]; then # autoload - script+=( - "$fpath_script" - "builtin autoload -Uz \$fpath[-1]/*(N.:t)" - ) + script+=("$fpath_script") + if [[ "$o_fpath_rule[-1]" == prepend ]]; then + script+=("builtin autoload -Uz \$fpath[1]/*(N.:t)") + else + script+=("builtin autoload -Uz \$fpath[-1]/*(N.:t)") + fi else if zstyle -t ":antidote:bundle:$bundle" zcompile; then __antidote_bundle_zcompile $bundle_path fi if [[ $bundle_type == file ]]; then - script+="$source_cmd $bundle_path" + script+="$source_cmd $print_bundle_path" else # directory/default local initfile initfiles initfiles=(${(@f)$(__antidote_initfiles $bundle_path)}) # if no init file was found, assume the default if [[ $#initfiles -eq 0 ]]; then - initfiles=($bundle_path/${bundle_path:t}.plugin.zsh) + if (( $#o_path )); then + initfiles=($bundle_path/${bundle_path:t}.plugin.zsh) + else + initfiles=($bundle_path/${bundle_name:t}.plugin.zsh) + fi fi script+="$fpath_script" + local print_initfile for initfile in $initfiles; do - script+="$source_cmd $initfile" + print_initfile="$(__antidote_print_path "$initfile")" + script+="$source_cmd $print_initfile" done fi fi diff --git a/functions/antidote-update b/functions/antidote-update index 4836873..2daed4d 100644 --- a/functions/antidote-update +++ b/functions/antidote-update @@ -21,14 +21,12 @@ fi # colors - local bold green normal + local green normal if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then if (( $+commands[tput] )); then - bold=$(tput bold) green=$(tput setaf 2) normal=$(tput sgr0) else - bold=$'\E\[1m' green=$'\E[32m' normal=$'\E[0m' fi @@ -39,7 +37,11 @@ local bundledir url repo # remove zcompiled files - rm -rf -- $(antidote-home)/**/*.zwc(N) + __antidote_del -rf -- $(antidote-home)/**/*.zwc(N) + + # remove check file + local loadable_check_path="$(antidote-home)/.antidote.load" + [[ -r "$loadable_check_path" ]] && __antidote_del -- "$loadable_check_path" # update all bundles for bundledir in $(antidote-list --dirs); do @@ -51,7 +53,7 @@ git -C "$1" pull --quiet --ff --rebase --autostash local newsha=$(git -C "$1" rev-parse --short HEAD) if [[ $oldsha != $newsha ]]; then - print "${bold}${green}antidote: updated: $2 ${oldsha} -> ${newsha}${normal}" + print "${green}antidote: updated: $2 ${oldsha} -> ${newsha}${normal}" git -C "$1" --no-pager log --oneline --ancestry-path ${oldsha}..${newsha} 2>/dev/null fi @@ -64,7 +66,7 @@ print "Waiting for bundle updates to complete..." print "" wait - print "${bold}${green}Bundle updates complete.${normal}" + print "${green}Bundle updates complete.${normal}" print "" fi diff --git a/makefile b/makefile index 804adca..3a6dc6e 100644 --- a/makefile +++ b/makefile @@ -43,6 +43,6 @@ bump-min: bump-rev: ./tools/bumpver revision -##? bumpber bump the revision version (0.0.X) +##? bumpver bump the revision version (0.0.X) bumpver: ./tools/bumpver revision diff --git a/man/antidote.md b/man/antidote.md index f0aec70..3affea6 100644 --- a/man/antidote.md +++ b/man/antidote.md @@ -161,6 +161,14 @@ Or, to Zsh compile everything, static file and all bundles: | zstyle ':antidote:*' zcompile 'yes' +By default, antidote appends to the end of your $fpath. This is highly recommended, however if you really want to change that behavior, there's a zstyle for that: + +| zstyle ':antidote:fpath' rule 'prepend' + +By default, antidote uses romkatv/zsh-defer for deferred plugins. If there's a fork you'd prefer to use, you can specify that with this zstyle: + +| zstyle ':antidote:defer' bundle 'getantidote/zsh-defer' + # SEE ALSO For more information, visit https://getantidote.github.io/ diff --git a/man/man1/antidote-bundle.1 b/man/man1/antidote-bundle.1 index 072b718..a587c65 100644 --- a/man/man1/antidote-bundle.1 +++ b/man/man1/antidote-bundle.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pandoc 3.1.12.2 +.\" Automatically generated by Pandoc .\" .TH "antidote\-bundle" "1" "" "" "Antidote Manual" .SH NAME diff --git a/man/man1/antidote-help.1 b/man/man1/antidote-help.1 index 2cc4aa5..e384564 100644 --- a/man/man1/antidote-help.1 +++ b/man/man1/antidote-help.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pandoc 3.1.12.2 +.\" Automatically generated by Pandoc .\" .TH "antidote\-help" "1" "" "" "Antidote Manual" .SH NAME diff --git a/man/man1/antidote-home.1 b/man/man1/antidote-home.1 index b818048..a43d8cc 100644 --- a/man/man1/antidote-home.1 +++ b/man/man1/antidote-home.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pandoc 3.1.12.2 +.\" Automatically generated by Pandoc .\" .TH "antidote\-home" "1" "" "" "Antidote Manual" .SH NAME diff --git a/man/man1/antidote-init.1 b/man/man1/antidote-init.1 index f642bdb..496a0c0 100644 --- a/man/man1/antidote-init.1 +++ b/man/man1/antidote-init.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pandoc 3.1.12.2 +.\" Automatically generated by Pandoc .\" .TH "antidote\-init" "1" "" "" "Antidote Manual" .SH NAME diff --git a/man/man1/antidote-install.1 b/man/man1/antidote-install.1 index 60f7957..c6fc8b9 100644 --- a/man/man1/antidote-install.1 +++ b/man/man1/antidote-install.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pandoc 3.1.12.2 +.\" Automatically generated by Pandoc .\" .TH "antidote\-install" "1" "" "" "Antidote Manual" .SH NAME diff --git a/man/man1/antidote-list.1 b/man/man1/antidote-list.1 index 90668ab..eba1ea9 100644 --- a/man/man1/antidote-list.1 +++ b/man/man1/antidote-list.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pandoc 3.1.12.2 +.\" Automatically generated by Pandoc .\" .TH "antidote\-list" "1" "" "" "Antidote Manual" .SH NAME diff --git a/man/man1/antidote-load.1 b/man/man1/antidote-load.1 index 5ba24bf..b2bc9ae 100644 --- a/man/man1/antidote-load.1 +++ b/man/man1/antidote-load.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pandoc 3.1.12.2 +.\" Automatically generated by Pandoc .\" .TH "antidote\-load" "1" "" "" "Antidote Manual" .SH NAME diff --git a/man/man1/antidote-path.1 b/man/man1/antidote-path.1 index e13c784..fa9b812 100644 --- a/man/man1/antidote-path.1 +++ b/man/man1/antidote-path.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pandoc 3.1.12.2 +.\" Automatically generated by Pandoc .\" .TH "antidote\-path" "1" "" "" "Antidote Manual" .SH NAME diff --git a/man/man1/antidote-purge.1 b/man/man1/antidote-purge.1 index 0a5144e..b3c9d04 100644 --- a/man/man1/antidote-purge.1 +++ b/man/man1/antidote-purge.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pandoc 3.1.12.2 +.\" Automatically generated by Pandoc .\" .TH "antidote\-purge" "1" "" "" "Antidote Manual" .SH NAME diff --git a/man/man1/antidote-update.1 b/man/man1/antidote-update.1 index 97e5e4e..03f14ed 100644 --- a/man/man1/antidote-update.1 +++ b/man/man1/antidote-update.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pandoc 3.1.12.2 +.\" Automatically generated by Pandoc .\" .TH "antidote\-update" "1" "" "" "Antidote Manual" .SH NAME diff --git a/man/man1/antidote.1 b/man/man1/antidote.1 index ea29ac4..c5cc4e2 100644 --- a/man/man1/antidote.1 +++ b/man/man1/antidote.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pandoc 3.1.12.2 +.\" Automatically generated by Pandoc .\" .TH "antidote" "1" "" "" "Antidote Manual" .SH NAME @@ -232,6 +232,22 @@ zcompile `no' The static file can be Zsh compiled with the following \f[B]zstyle\f[R]: .PP \ \ zstyle `:antidote:static' zcompile `yes' +.PP +Or, to Zsh compile everything, static file and all bundles: +.PP +\ \ zstyle \[cq]:antidote:*\[cq] zcompile `yes' +.PP +By default, antidote appends to the end of your $fpath. +This is highly recommended, however if you really want to change that +behavior, there\[cq]s a zstyle for that: +.PP +\ \ zstyle `:antidote:fpath' rule `prepend' +.PP +By default, antidote uses romkatv/zsh\-defer for deferred plugins. +If there\[cq]s a fork you\[cq]d prefer to use, you can specify that with +this zstyle: +.PP +\ \ zstyle `:antidote:defer' bundle `getantidote/zsh\-defer' .SH SEE ALSO For more information, visit https://getantidote.github.io/ .SH BUGS diff --git a/tests/README.md b/tests/README.md index 352e980..47f581f 100644 --- a/tests/README.md +++ b/tests/README.md @@ -59,7 +59,7 @@ The `-v/--version` flag displays the current version: ```zsh % antidote --version -antidote version 1.9.6 +antidote version 1.9.7 % ``` diff --git a/tests/functions/filter-comments b/tests/functions/filter-comments deleted file mode 100644 index e6d66c3..0000000 --- a/tests/functions/filter-comments +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/zsh -awk '/^A/{next};1' diff --git a/tests/functions/is-macos b/tests/functions/is-macos deleted file mode 100644 index ea59f48..0000000 --- a/tests/functions/is-macos +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/zsh -[[ "$OSTYPE" == darwin* ]] diff --git a/tests/functions/mockgit b/tests/functions/mockgit index e787c98..f2b9a9e 100644 --- a/tests/functions/mockgit +++ b/tests/functions/mockgit @@ -40,13 +40,17 @@ echo "MOCKGIT: repository '$url' not found" fi elif [[ "$@" = "config remote.origin.url" ]]; then - # un-sanitize dir into URL - local url=$o_path[-1] - url=${url:t} - url=${url:gs/-AT-/\@} - url=${url:gs/-COLON-/\:} - url=${url:gs/-SLASH-/\/} - echo "$url" + if [[ -e $bundledir/.git/config/remote.origin.url ]]; then + cat $bundledir/.git/config/remote.origin.url + else + # un-sanitize dir into URL + local url=$o_path[-1] + url=${url:t} + url=${url:gs/-AT-/\@} + url=${url:gs/-COLON-/\:} + url=${url:gs/-SLASH-/\/} + echo "$url" + fi elif [[ "$@" = "pull" ]]; then (( $#o_quiet )) || echo "MOCKGIT: Already up to date." elif [[ "$@" = "rev-parse HEAD" ]]; then diff --git a/tests/functions/sed-i b/tests/functions/sed-i deleted file mode 100644 index 806e2e5..0000000 --- a/tests/functions/sed-i +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/zsh -#function sed-i { - sed --version &>/dev/null && sed -i -- "$@" || sed -i "" "$@" -#} diff --git a/tests/functions/subenv b/tests/functions/subenv index f4d4cef..09ec078 100644 --- a/tests/functions/subenv +++ b/tests/functions/subenv @@ -1,10 +1,17 @@ #!/bin/zsh #function subenv { + emulate -L zsh; setopt local_options + if (( $# == 0 )); then - subenv ANTIDOTE_HOME | subenv ZDOTDIR | subenv HOME - else - local sedexp="s|${(P)1}|\$$1|g" - shift - sed "$sedexp" "$@" + set -- HOME fi + + local -a sedargs=(-e "s|\$HOME|$HOME|g") + while (( $# )); do + if [[ -v "$1" ]]; then + sedargs+=(-e "s|${(P)1}|\$$1|g") + fi + shift + done + sed "$sedargs[@]" #} diff --git a/tests/functions/t_setup b/tests/functions/t_setup index cdfec0a..47f5c85 100644 --- a/tests/functions/t_setup +++ b/tests/functions/t_setup @@ -1,11 +1,15 @@ #!/bin/zsh #function t_setup { + emulate -L zsh + setopt local_options extended_glob glob_dots + 0=${(%):-%x} local prjdir="${0:A:h:h:h}" local testdir="${0:A:h:h}" - # save fpath - typeset -g T_PREV_FPATH=( $fpath ) + # save path/fpath + typeset -ga T_PREV_PATH=( $path ) + typeset -ga T_PREV_FPATH=( $fpath ) # save zstyles, and clear them all for the test session typeset -ga T_PREV_ZSTYLES=( ${(@f)"$(zstyle -L ':antidote:*')"} ) @@ -20,15 +24,23 @@ # works with BSD and GNU gmktemp T_TEMPDIR=${$(mktemp -d -t t_antidote.XXXXXXXX):A} + typeset -g T_PREV_HOME=$HOME + typeset -g T_PREV_ZDOTDIR=$ZDOTDIR + + export HOME=$T_TEMPDIR + export ZDOTDIR=$HOME/.zsh + typeset -g ANTIDOTE_HOME=$HOME/.cache/antidote - # put zdotdir in position - cp -rf $testdir/zdotdir $T_TEMPDIR + # put tmp_home into position + for p in $testdir/tmp_home/*; do + cp -rf $p $T_TEMPDIR + done + + # rename .mockgit to .git local mockdir for mockdir in $T_TEMPDIR/**/.mock*; do mv $mockdir ${mockdir:s/.mock/.} done - typeset -g OLD_ZDOTDIR=$ZDOTDIR - export ZDOTDIR=$T_TEMPDIR/zdotdir # our mock plugins use this typeset -ga plugins=() @@ -37,7 +49,6 @@ # setup antidote zstyle ':antidote:tests' set-warn-options 'on' zstyle ':antidote:tests' cloning 'off' - - # load antidote - typeset -g ANTIDOTE_HOME=$ZDOTDIR/antidote_home + zstyle ':antidote:bundle' use-friendly-names on + zstyle ':antidote:defer' bundle 'getantidote/zsh-defer' #} diff --git a/tests/functions/t_setup_real b/tests/functions/t_setup_real index b9fd35c..1bfc0e7 100644 --- a/tests/functions/t_setup_real +++ b/tests/functions/t_setup_real @@ -8,18 +8,21 @@ zstyle ':antidote:tests' cloning 'on' (( $+functions[git] )) && unfunction git + # unset other testing zstyles + zstyle -d ':antidote:defer' bundle + # unset rupa/z (( $+aliases[z] )) && unalias z # replace .zsh_plugins.txt with real versions local file for file in .zsh_plugins.txt .zsh_plugins.zsh; do - [[ -f $ZDOTDIR/$file ]] && rm -f -- "$ZDOTDIR/$file" - [[ -f $testdir/real/$file ]] && rm -f -- "$testdir/real/$file" + [[ -f $ZDOTDIR/$file ]] && command rm -f -- "$ZDOTDIR/$file" + [[ -f $testdir/real/$file ]] && command rm -f -- "$testdir/real/$file" done # clean out antidote home - [[ -d $ANTIDOTE_HOME ]] && rm -rf -- "$ANTIDOTE_HOME" + [[ -d $ANTIDOTE_HOME ]] && command rm -rf -- "$ANTIDOTE_HOME" mkdir -p "$ANTIDOTE_HOME" # source antidote diff --git a/tests/functions/t_teardown b/tests/functions/t_teardown index 56db9ec..24eae4f 100644 --- a/tests/functions/t_teardown +++ b/tests/functions/t_teardown @@ -5,7 +5,8 @@ setopt local_options # reset current session - ZDOTDIR=$OLD_ZDOTDIR + HOME=$T_PREV_HOME + ZDOTDIR=$T_PREV_ZDOTDIR # unfunction all antidote for fn in ${(k)functions}; do @@ -16,17 +17,28 @@ # unfunction zsh-defer (( $+functions[zsh-defer] )) && unfunction zsh-defer - # restore original fpath + # restore original path/fpath + path=( $T_PREV_PATH ) fpath=( $T_PREV_FPATH ) # restore original zstyles source <(zstyle -L ':antidote:*' | awk '{print "zstyle -d",$2}') source <(printf '%s\n' $T_PREV_ZSTYLES) - # remove vars - [[ -v plugins ]] && unset plugins - [[ -v libs ]] && unset libs - # remove tempdir - [[ -d "$T_TEMPDIR" ]] && rm -rf -- "$T_TEMPDIR" + [[ -d "$T_TEMPDIR" ]] && command rm -rf -- "$T_TEMPDIR" + + # remove vars + for var in \ + ANTIDOTE_HOME \ + T_TEMPDIR \ + T_PREV_HOME \ + T_PREV_ZDOTDIR \ + T_PREV_PATH \ + T_PREV_FPATH \ + plugins \ + libs + do + [[ -v $var ]] && unset $var + done #} diff --git a/tests/functions/t_unload_antidote b/tests/functions/t_unload_antidote new file mode 100644 index 0000000..25a48a4 --- /dev/null +++ b/tests/functions/t_unload_antidote @@ -0,0 +1,13 @@ +#!/bin/zsh + +emulate -L zsh +setopt local_options + +# unfunction all antidote +for fn in ${(k)functions}; do + [[ $fn == *antidote* ]] && [[ $fn != t_* ]] && unfunction -- $fn +done +(( $+functions[git] )) && unfunction git + +# unfunction zsh-defer +(( $+functions[zsh-defer] )) && unfunction zsh-defer diff --git a/tests/test_alt_zsh_defer_bundle.md b/tests/test_alt_zsh_defer_bundle.md new file mode 100644 index 0000000..1590bdc --- /dev/null +++ b/tests/test_alt_zsh_defer_bundle.md @@ -0,0 +1,35 @@ +# antidote test alternative zsh-defer repo + +## Setup + +```zsh +% source ./tests/_setup.zsh +% source ./antidote.zsh +% +``` + +## Customize zsh-defer + +If the user forks zsh-defer, support setting a zstyle for an alternative repo location. + +### General + +```zsh +% zstyle ':antidote:bundle' use-friendly-names on +% zstyle ':antidote:defer' bundle 'custom/zsh-defer' +% antidote bundle 'zsh-users/zsh-autosuggestions kind:defer' 2>/dev/null +if ! (( $+functions[zsh-defer] )); then + fpath+=( $HOME/.cache/antidote/custom/zsh-defer ) + source $HOME/.cache/antidote/custom/zsh-defer/zsh-defer.plugin.zsh +fi +fpath+=( $HOME/.cache/antidote/zsh-users/zsh-autosuggestions ) +zsh-defer source $HOME/.cache/antidote/zsh-users/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh +% +``` + +## Teardown + +```zsh +% t_teardown +% +``` diff --git a/tests/test_antidote.md b/tests/test_antidote.md index b126832..24770a0 100644 --- a/tests/test_antidote.md +++ b/tests/test_antidote.md @@ -1,33 +1,29 @@ -# antidote core tests +# antidote bundle tests -fails gracefully when someone tries bash +## Setup ```zsh -% bash -c "source $PWD/antidote.zsh" -antidote: Expecting zsh. Found 'bash'. +% source ./tests/_setup.zsh +% source ./antidote.zsh % ``` -## Setup +## Version + +Show antidote's version: ```zsh -% echo $+functions[antidote] -0 -% source ./tests/_setup.zsh -% source ./antidote.zsh -% echo $+functions[antidote] -1 -% git --version -0.0.0 +% antidote --version +antidote version 1.9.7 % ``` -## General +## Help -No args displays help: +Show antidote's functionality: ```zsh -% antidote +% antidote --help antidote - the cure to slow zsh plugin management usage: antidote [] [ ...] @@ -50,80 +46,251 @@ commands: % ``` -No arg exit status is 2: +## Bundling + +Bundle the foo/bar repo using old antibody style directories: ```zsh -% antidote >/dev/null; err=$? -% echo $err -2 +% zstyle ':antidote:bundle' use-friendly-names off +% antidote bundle foo/bar +# antidote cloning foo/bar... +fpath+=( $HOME/.cache/antidote/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar ) +source $HOME/.cache/antidote/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/bar.plugin.zsh % ``` -## Help +Use new-style directory naming: + +```zsh +% zstyle ':antidote:bundle' use-friendly-names on +% +``` -`-h` and `--help` work: +Bundle a repo at https://github.com/foo/bar ```zsh -% antidote -h >/dev/null; err=$? -% echo $err -0 -% antidote --help >/dev/null; err=$? -% echo $err -0 +% antidote bundle foo/bar +fpath+=( $HOME/.cache/antidote/foo/bar ) +source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh % ``` -## Version +Bundle a repo at git@bitbucket.org:foo/bar -`-v` and `--version` work: +```zsh +% antidote bundle git@bitbucket.org:foo/bar +fpath+=( $HOME/.cache/antidote/foo/bar ) +source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh +% +``` + +Bundle a specific branch of a repo with `branch:`. ```zsh -% antidote --version -antidote version 1.9.6 -% antidote -v >/dev/null; echo $? -0 -% antidote --version >/dev/null; echo $? -0 +% antidote bundle foo/bar branch:dev +fpath+=( $HOME/.cache/antidote/foo/bar ) +source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh +% +``` + +### Annotations: kind + +Bundles support a `kind:` annotation. The default is `kind:zsh`. + +```zsh +% antidote bundle foo/bar kind:zsh +fpath+=( $HOME/.cache/antidote/foo/bar ) +source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh +% +``` + +Bundle foo/bar with `kind:path` to add it to your `$PATH`. + +```zsh +% antidote bundle foo/bar kind:path +export PATH="$HOME/.cache/antidote/foo/bar:$PATH" +% +``` + +Bundle foo/bar with `kind:fpath` to add it to your `$fpath`. + +```zsh +% antidote bundle foo/bar kind:fpath +fpath+=( $HOME/.cache/antidote/foo/bar ) +% +``` + +Bundle foo/bar with `kind:clone` to just clone the repo, but do nothing to load it. + +```zsh +% antidote bundle foo/bar kind:clone +% +``` + +Autoload a path within foo/bar with the `kind:autoload` annotation. + +```zsh +% antidote bundle foo/baz kind:autoload path:functions +fpath+=( $HOME/.cache/antidote/foo/baz/functions ) +builtin autoload -Uz $fpath[-1]/*(N.:t) +% +``` + +Defer loading the foo/bar bundle with the `kind:defer` annotation. + +```zsh +% antidote bundle foo/baz kind:defer +if ! (( $+functions[zsh-defer] )); then + fpath+=( $HOME/.cache/antidote/getantidote/zsh-defer ) + source $HOME/.cache/antidote/getantidote/zsh-defer/zsh-defer.plugin.zsh +fi +fpath+=( $HOME/.cache/antidote/foo/baz ) +zsh-defer source $HOME/.cache/antidote/foo/baz/baz.plugin.zsh +% +``` + +### Annotations: path + +Use the `path:` annotation to load subplugins. + +```zsh +% antidote bundle ohmy/ohmy path:plugins/docker +fpath+=( $HOME/.cache/antidote/ohmy/ohmy/plugins/docker ) +source $HOME/.cache/antidote/ohmy/ohmy/plugins/docker/docker.plugin.zsh +% +``` + +Use `path:` to load a whole directory full of files. + +```zsh +% antidote bundle ohmy/ohmy path:lib +fpath+=( $HOME/.cache/antidote/ohmy/ohmy/lib ) +source $HOME/.cache/antidote/ohmy/ohmy/lib/lib1.zsh +source $HOME/.cache/antidote/ohmy/ohmy/lib/lib2.zsh +source $HOME/.cache/antidote/ohmy/ohmy/lib/lib3.zsh % ``` -## Unrecognized options +Use `path:` to load a specific file. ```zsh -% antidote --foo >/dev/null; err=$? #=> --regex (bad option|command not found) -% echo $err -1 +% antidote bundle ohmy/ohmy path:custom/themes/pretty.zsh-theme +source $HOME/.cache/antidote/ohmy/ohmy/custom/themes/pretty.zsh-theme % ``` -## Unrecognized commands +### Annotations: conditional + +Use a existing boolean function to wrap a bundle in `if` logic: ```zsh -% antidote foo; err=$? -antidote: command not found 'foo' -% echo $err -1 +% is-macos() { [[ "$OSTYPE" == "darwin"* ]]; } +% antidote bundle foo/bar conditional:is-macos +if is-macos; then + fpath+=( $HOME/.cache/antidote/foo/bar ) + source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh +fi % ``` -## All commands +## Dynamic bundling + +If you run `source <(antidote init)`, antidote will emit a wrapper so that you can +dynamically bundle. ```zsh -% cmds=( bundle help home init install list load path purge update script main null ) -% for cmd in $cmds; echo $+functions[antidote-$cmd] -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -0 +% antidote init +#!/usr/bin/env zsh +function antidote { + case "$1" in + bundle) + source <( antidote-main $@ ) || antidote-main $@ + ;; + *) + antidote-main $@ + ;; + esac +} +% +``` + +## Home + +Show where antidote stores its bundles: + +```zsh +% antidote home | subenv HOME +$HOME/.cache/antidote +% +``` + +## List bundles + +List directories: + +```zsh +% antidote list --dirs | subenv HOME +$HOME/.cache/antidote/foo/bar +$HOME/.cache/antidote/foo/baz +$HOME/.cache/antidote/foo/qux +$HOME/.cache/antidote/getantidote/zsh-defer +$HOME/.cache/antidote/ohmy/ohmy +% +``` + +List repo URLs: + +```zsh +% antidote list --url +git@github.com:foo/qux +https://github.com/foo/bar +https://github.com/foo/baz +https://github.com/getantidote/zsh-defer +https://github.com/ohmy/ohmy +% +``` + +List short repos: + +```zsh +% antidote list --short +foo/bar +foo/baz +getantidote/zsh-defer +git@github.com:foo/qux +ohmy/ohmy +% +``` + +## Bundle paths + +Show the path to a bundle: + +```zsh +% ZSH=$(antidote path ohmy/ohmy) +% echo $ZSH | subenv HOME +$HOME/.cache/antidote/ohmy/ohmy +% +``` + +## Update bundles + +```zsh +% antidote update +Updating bundles... +antidote: checking for updates: https://github.com/foo/bar +antidote: checking for updates: https://github.com/foo/baz +antidote: checking for updates: git@github.com:foo/qux +antidote: checking for updates: https://github.com/getantidote/zsh-defer +antidote: checking for updates: https://github.com/ohmy/ohmy +Waiting for bundle updates to complete... + +Bundle updates complete. + +Updating antidote... +antidote self-update complete. + +antidote version 1.9.7 % ``` diff --git a/tests/test_antidote_core.md b/tests/test_antidote_core.md new file mode 100644 index 0000000..decd967 --- /dev/null +++ b/tests/test_antidote_core.md @@ -0,0 +1,135 @@ +# antidote core tests + +fails gracefully when someone tries bash + +```zsh +% bash -c "source $PWD/antidote.zsh" +antidote: Expecting zsh. Found 'bash'. +% +``` + +## Setup + +```zsh +% echo $+functions[antidote] +0 +% source ./tests/_setup.zsh +% source ./antidote.zsh +% echo $+functions[antidote] +1 +% git --version +0.0.0 +% +``` + +## General + +No args displays help: + +```zsh +% antidote +antidote - the cure to slow zsh plugin management + +usage: antidote [] [ ...] + +flags: + -h, --help Show context-sensitive help + -v, --version Show application version + +commands: + help Show documentation + load Statically source all bundles from the plugins file + bundle Clone bundle(s) and generate the static load script + install Clone a new bundle and add it to your plugins file + update Update antidote and its cloned bundles + purge Remove a cloned bundle + home Print where antidote is cloning bundles + list List cloned bundles + path Print the path of a cloned bundle + init Initialize the shell for dynamic bundles +% +``` + +No arg exit status is 2: + +```zsh +% antidote >/dev/null; err=$? +% echo $err +2 +% +``` + +## Help + +`-h` and `--help` work: + +```zsh +% antidote -h >/dev/null; err=$? +% echo $err +0 +% antidote --help >/dev/null; err=$? +% echo $err +0 +% +``` + +## Version + +`-v` and `--version` work: + +```zsh +% antidote --version +antidote version 1.9.7 +% antidote -v >/dev/null; echo $? +0 +% antidote --version >/dev/null; echo $? +0 +% +``` + +## Unrecognized options + +```zsh +% antidote --foo >/dev/null; err=$? #=> --regex (bad option|command not found) +% echo $err +1 +% +``` + +## Unrecognized commands + +```zsh +% antidote foo; err=$? +antidote: command not found 'foo' +% echo $err +1 +% +``` + +## All commands + +```zsh +% cmds=( bundle help home init install list load path purge update script main null ) +% for cmd in $cmds; echo $+functions[antidote-$cmd] +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +0 +% +``` + +## Teardown + +```zsh +% t_teardown +% +``` diff --git a/tests/test_bundle_helpers.md b/tests/test_bundle_helpers.md index 37585dc..6ffdc51 100644 --- a/tests/test_bundle_helpers.md +++ b/tests/test_bundle_helpers.md @@ -18,12 +18,12 @@ The repo parser pulls a list of all git URLs in a bundle file so that we can clo % __antidote_bulk_clone $TESTDATA/.zsh_plugins_repos.txt antidote-script --kind clone --branch baz foobar/foobar & antidote-script --kind clone bar/baz & +antidote-script --kind clone getantidote/zsh-defer & antidote-script --kind clone git@github.com:user/repo & antidote-script --kind clone http://github.com/user/repo.git & -antidote-script --kind clone https://github.com/baz/qux & -antidote-script --kind clone https://github.com/qux/baz & +antidote-script --kind clone https://github.com/foo/baz & +antidote-script --kind clone https://github.com/foo/qux & antidote-script --kind clone https://github.com/user/repo & -antidote-script --kind clone romkatv/zsh-defer & antidote-script --kind clone user/repo & wait % @@ -46,8 +46,8 @@ Test that only the first defer block is kept... fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-history-substring-search ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-history-substring-search/zsh-history-substring-search.plugin.zsh if ! (( $+functions[zsh-defer] )); then - fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh + fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-getantidote-SLASH-zsh-defer ) + source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-getantidote-SLASH-zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-syntax-highlighting ) zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh @@ -113,11 +113,10 @@ The bundle parser is an awk script that turns the bundle DSL into antidote-scrip ```zsh % __antidote_parse_bundles $ZDOTDIR/.zsh_plugins.txt antidote-script ~/foo/bar -antidote-script \$ZDOTDIR/foo/bar -antidote-script --path baz \$ZDOTDIR/foo/bar +antidote-script --path plugins/myplugin \$ZSH_CUSTOM antidote-script foo/bar -antidote-script git@github.com:baz/qux.git -antidote-script --kind clone romkatv/zsh-defer +antidote-script git@github.com:foo/qux.git +antidote-script --kind clone getantidote/zsh-defer antidote-script --kind zsh foo/bar antidote-script --kind fpath foo/bar antidote-script --kind path foo/bar diff --git a/tests/test_cmd_bundle.md b/tests/test_cmd_bundle.md index 34d9acc..7322de5 100644 --- a/tests/test_cmd_bundle.md +++ b/tests/test_cmd_bundle.md @@ -33,20 +33,24 @@ handling a single bundle, and 'antidote bundle' handling them in bulk. Test \|piping, \ --file testdata/script-foobar.zsh % echo 'foo/bar' | antidote bundle | subenv ANTIDOTE_HOME #=> --file testdata/script-foobar.zsh % echo 'foo/bar' >$ZDOTDIR/.zsh_plugins_simple.txt % antidote bundle <$ZDOTDIR/.zsh_plugins_simple.txt | subenv ANTIDOTE_HOME #=> --file testdata/script-foobar.zsh +% zstyle ':antidote:bundle' use-friendly-names on +% ANTIDOTE_HOME=$HOME/.cache/antidote % ``` ## Fails ```zsh -% echo "foo/bar\nbar/baz kind:whoops" | antidote bundle 2>&1 | subenv ANTIDOTE_HOME +% echo "foo/bar\nfoo/baz kind:whoops" | antidote bundle 2>&1 | subenv ANTIDOTE_HOME antidote: error: unexpected kind value: 'whoops' -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/bar.plugin.zsh +fpath+=( $ANTIDOTE_HOME/foo/bar ) +source $ANTIDOTE_HOME/foo/bar/bar.plugin.zsh % ``` diff --git a/tests/test_cmd_init.md b/tests/test_cmd_init.md index 22ff6b8..6cf7879 100644 --- a/tests/test_cmd_init.md +++ b/tests/test_cmd_init.md @@ -32,8 +32,8 @@ Load plugins dynamically % source <(antidote init) % antidote bundle foo/bar sourcing foo/bar... -% antidote bundle bar/baz autoload:functions -sourcing bar/baz... +% antidote bundle foo/baz autoload:functions +sourcing foo/baz... % antidote bundle $ZDOTDIR/custom/lib sourcing custom lib1.zsh... sourcing custom lib2.zsh... diff --git a/tests/test_cmd_install.md b/tests/test_cmd_install.md index 8b2ff82..efb6ecc 100644 --- a/tests/test_cmd_install.md +++ b/tests/test_cmd_install.md @@ -23,7 +23,7 @@ Trying to install an existing bundle fails. ```zsh % antidote install foo/bar &>/dev/null #=> --exit 1 % antidote install foo/bar 2>&1 | subenv ANTIDOTE_HOME >&2 -antidote: error: foo/bar already installed: $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar +antidote: error: foo/bar already installed: $ANTIDOTE_HOME/foo/bar % ``` diff --git a/tests/test_cmd_list.md b/tests/test_cmd_list.md index 78c013d..01bb057 100644 --- a/tests/test_cmd_list.md +++ b/tests/test_cmd_list.md @@ -16,11 +16,11 @@ ```zsh % antidote list --short | subenv ANTIDOTE_HOME -bar/baz foo/bar -git@github.com:baz/qux +foo/baz +getantidote/zsh-defer +git@github.com:foo/qux ohmy/ohmy -romkatv/zsh-defer % ``` @@ -30,11 +30,11 @@ romkatv/zsh-defer ```zsh % antidote list --dirs | subenv ANTIDOTE_HOME -$ANTIDOTE_HOME/git-AT-github.aaakk.us.kg-COLON-baz-SLASH-qux -$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-bar-SLASH-baz -$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar -$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy -$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer +$ANTIDOTE_HOME/foo/bar +$ANTIDOTE_HOME/foo/baz +$ANTIDOTE_HOME/foo/qux +$ANTIDOTE_HOME/getantidote/zsh-defer +$ANTIDOTE_HOME/ohmy/ohmy % ``` @@ -44,11 +44,11 @@ $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defe ```zsh % antidote list --url -git@github.com:baz/qux -https://github.com/bar/baz +git@github.com:foo/qux https://github.com/foo/bar +https://github.com/foo/baz +https://github.com/getantidote/zsh-defer https://github.com/ohmy/ohmy -https://github.com/romkatv/zsh-defer % ``` @@ -58,11 +58,11 @@ https://github.com/romkatv/zsh-defer ```zsh % antidote list | subenv ANTIDOTE_HOME -git@github.com:baz/qux $ANTIDOTE_HOME/git-AT-github.aaakk.us.kg-COLON-baz-SLASH-qux -https://github.com/bar/baz $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-bar-SLASH-baz -https://github.com/foo/bar $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar -https://github.com/ohmy/ohmy $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy -https://github.com/romkatv/zsh-defer $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer +git@github.com:foo/qux $ANTIDOTE_HOME/foo/qux +https://github.com/foo/bar $ANTIDOTE_HOME/foo/bar +https://github.com/foo/baz $ANTIDOTE_HOME/foo/baz +https://github.com/getantidote/zsh-defer $ANTIDOTE_HOME/getantidote/zsh-defer +https://github.com/ohmy/ohmy $ANTIDOTE_HOME/ohmy/ohmy % ``` diff --git a/tests/test_cmd_load.md b/tests/test_cmd_load.md index d711cbd..64e0ccf 100644 --- a/tests/test_cmd_load.md +++ b/tests/test_cmd_load.md @@ -13,7 +13,7 @@ ```zsh % antidote load $ZDOTDIR/.zplugins_fake_load sourcing foo/bar... -sourcing baz/qux... +sourcing foo/qux... sourcing foo/bar... sourcing ohmy/lib/lib1.zsh... sourcing ohmy/lib/lib2.zsh... @@ -21,7 +21,7 @@ sourcing ohmy/lib/lib3.zsh... sourcing extract.plugin.zsh... sourcing docker.plugin.zsh... sourcing docker.plugin.zsh... -sourcing romkatv/zsh-defer... +sourcing getantidote/zsh-defer... sourcing magic-enter.plugin.zsh... sourcing pretty.zsh-theme... % cat $ZDOTDIR/.zplugins_fake_load.zsh | subenv #=> --file testdata/.zplugins_fake_load.zsh @@ -37,14 +37,14 @@ sourcing pretty.zsh-theme... % zstyle ':antidote:bundle' file $ZDOTDIR/.zplugins.txt % zstyle ':antidote:static' file $ZDOTDIR/.zplugins.txt % # the static file should be different -% antidote load 2>&1 | subenv +% antidote load 2>&1 | subenv ZDOTDIR antidote: bundle file and static file are the same '$ZDOTDIR/.zplugins.txt'. % # fixed... % zstyle ':antidote:static' file $ZDOTDIR/.zplugins.static.zsh % # the static file should be different % antidote load sourcing foo/bar... -sourcing baz/qux... +sourcing foo/qux... sourcing foo/bar... sourcing ohmy/lib/lib1.zsh... sourcing ohmy/lib/lib2.zsh... @@ -52,7 +52,7 @@ sourcing ohmy/lib/lib3.zsh... sourcing extract.plugin.zsh... sourcing docker.plugin.zsh... sourcing docker.plugin.zsh... -sourcing romkatv/zsh-defer... +sourcing getantidote/zsh-defer... sourcing magic-enter.plugin.zsh... sourcing pretty.zsh-theme... % cat $ZDOTDIR/.zplugins.static.zsh | subenv #=> --file testdata/.zplugins_fake_load.zsh diff --git a/tests/test_cmd_main.md b/tests/test_cmd_main.md index e7fac46..f75c62a 100644 --- a/tests/test_cmd_main.md +++ b/tests/test_cmd_main.md @@ -27,7 +27,7 @@ Tests for lazy-loading antidote. % # Unload antidote % echo $+functions[antidote-main] 1 -% t_teardown +% t_unload_antidote % echo $+functions[antidote-main] 0 % # Now, lazy load it and make sure it works @@ -37,7 +37,7 @@ Tests for lazy-loading antidote. % # Now, tear down again % echo $+functions[antidote-main] 1 -% t_teardown +% t_unload_antidote % echo $+functions[antidote-main] 0 % # Now, lazy load from the functions dir diff --git a/tests/test_cmd_path.md b/tests/test_cmd_path.md index 4869dbf..dcf82d1 100644 --- a/tests/test_cmd_path.md +++ b/tests/test_cmd_path.md @@ -15,7 +15,7 @@ ```zsh % antidote path foo/bar &>/dev/null #=> --exit 0 % antidote path foo/bar | subenv ANTIDOTE_HOME -$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar +$ANTIDOTE_HOME/foo/bar % ``` @@ -33,12 +33,12 @@ antidote: error: bar/foo does not exist in cloned paths `antidote-path` accepts piped input ```zsh -% antidote list -s | antidote path | subenv ANTIDOTE_HOME -$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-bar-SLASH-baz -$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar -$ANTIDOTE_HOME/git-AT-github.aaakk.us.kg-COLON-baz-SLASH-qux -$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy -$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer +% antidote list -s | antidote path | sort | subenv ANTIDOTE_HOME +$ANTIDOTE_HOME/foo/bar +$ANTIDOTE_HOME/foo/baz +$ANTIDOTE_HOME/foo/qux +$ANTIDOTE_HOME/getantidote/zsh-defer +$ANTIDOTE_HOME/ohmy/ohmy % ``` @@ -47,7 +47,7 @@ $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defe ```zsh % ZSH_CUSTOM=$ZDOTDIR/custom % antidote path '$ZSH_CUSTOM/plugins/myplugin' | subenv -$ZDOTDIR/custom/plugins/myplugin +$HOME/.zsh/custom/plugins/myplugin % ``` diff --git a/tests/test_cmd_purge.md b/tests/test_cmd_purge.md index 09dfa3f..495e6ba 100644 --- a/tests/test_cmd_purge.md +++ b/tests/test_cmd_purge.md @@ -24,7 +24,7 @@ Trying to purge a missing bundle fails. ```zsh % antidote purge bar/foo &>/dev/null #=> --exit 1 % antidote purge bar/foo 2>&1 | subenv ANTIDOTE_HOME >&2 -antidote: error: bar/foo does not exist at the expected location: $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-bar-SLASH-foo +antidote: error: bar/foo does not exist at the expected location: $ANTIDOTE_HOME/bar/foo % ``` @@ -32,7 +32,7 @@ Purging a bundle deletes the directory and comments out instances of the bundle ```zsh % # bundle dir exists -% bundledir=$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar +% bundledir=$ANTIDOTE_HOME/foo/bar % test -d $bundledir #=> --exit 0 % # purge works % antidote purge foo/bar | subenv ZDOTDIR @@ -51,10 +51,10 @@ Test that `antidote purge --all` aborts when told "no". % zstyle ':antidote:purge:all' answer 'n' % antidote purge --all #=> --exit 1 % antidote list | subenv ANTIDOTE_HOME -git@github.com:baz/qux $ANTIDOTE_HOME/git-AT-github.aaakk.us.kg-COLON-baz-SLASH-qux -https://github.com/bar/baz $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-bar-SLASH-baz -https://github.com/ohmy/ohmy $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy -https://github.com/romkatv/zsh-defer $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer +git@github.com:foo/qux $ANTIDOTE_HOME/foo/qux +https://github.com/foo/baz $ANTIDOTE_HOME/foo/baz +https://github.com/getantidote/zsh-defer $ANTIDOTE_HOME/getantidote/zsh-defer +https://github.com/ohmy/ohmy $ANTIDOTE_HOME/ohmy/ohmy % ``` diff --git a/tests/test_cmd_script.md b/tests/test_cmd_script.md index 3229339..d7dd017 100644 --- a/tests/test_cmd_script.md +++ b/tests/test_cmd_script.md @@ -61,13 +61,18 @@ source $ZDOTDIR/custom/plugins/myplugin/myplugin.plugin.zsh % ``` -Script repos: +Script repos in antibody style: ```zsh +% zstyle ':antidote:bundle' use-friendly-names off +% ANTIDOTE_HOME=$HOME/.cache/antibody % antidote-script foo/bar | subenv ANTIDOTE_HOME #=> --file ./testdata/script-foobar.zsh % antidote-script https://github.com/foo/bar | subenv ANTIDOTE_HOME #=> --file ./testdata/script-foobar.zsh % antidote-script https://github.com/foo/bar.git | subenv ANTIDOTE_HOME #=> --file ./testdata/script-foobar.zsh -% antidote-script git@github.com:baz/qux.git | subenv ANTIDOTE_HOME #=> --file ./testdata/script-bazqux.zsh +% antidote-script git@github.com:foo/qux.git | subenv ANTIDOTE_HOME #=> --file ./testdata/script-fooqux.zsh +% zstyle ':antidote:bundle' use-friendly-names on +% ANTIDOTE_HOME=$HOME/.cache/antidote +% ``` ## Annotations @@ -93,8 +98,8 @@ Clone a missing plugin. ```zsh % antidote-script --kind zsh foo/bar | subenv ANTIDOTE_HOME -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/bar.plugin.zsh +fpath+=( $ANTIDOTE_HOME/foo/bar ) +source $ANTIDOTE_HOME/foo/bar/bar.plugin.zsh % ``` @@ -102,7 +107,7 @@ source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/b ```zsh % antidote-script --kind path foo/bar | subenv ANTIDOTE_HOME -export PATH="$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar:$PATH" +export PATH="$ANTIDOTE_HOME/foo/bar:$PATH" % ``` @@ -110,7 +115,7 @@ export PATH="$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH ```zsh % antidote-script --kind fpath foo/bar | subenv ANTIDOTE_HOME -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar ) +fpath+=( $ANTIDOTE_HOME/foo/bar ) % ``` @@ -128,11 +133,11 @@ builtin autoload -Uz $fpath[-1]/*(N.:t) ```zsh % antidote-script --kind defer foo/bar | subenv ANTIDOTE_HOME if ! (( $+functions[zsh-defer] )); then - fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh + fpath+=( $ANTIDOTE_HOME/getantidote/zsh-defer ) + source $ANTIDOTE_HOME/getantidote/zsh-defer/zsh-defer.plugin.zsh fi -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar ) -zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/bar.plugin.zsh +fpath+=( $ANTIDOTE_HOME/foo/bar ) +zsh-defer source $ANTIDOTE_HOME/foo/bar/bar.plugin.zsh % ``` @@ -143,20 +148,20 @@ Test defer zstyle settings % zstyle ':antidote:bundle:foo/bar' defer-options '-p' % antidote-script --kind defer foo/bar | subenv ANTIDOTE_HOME if ! (( $+functions[zsh-defer] )); then - fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh + fpath+=( $ANTIDOTE_HOME/getantidote/zsh-defer ) + source $ANTIDOTE_HOME/getantidote/zsh-defer/zsh-defer.plugin.zsh fi -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar ) -zsh-defer -p source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/bar.plugin.zsh +fpath+=( $ANTIDOTE_HOME/foo/bar ) +zsh-defer -p source $ANTIDOTE_HOME/foo/bar/bar.plugin.zsh % % # Uses different defer options due to zstyle matching % antidote-script --kind defer bar/baz | subenv ANTIDOTE_HOME if ! (( $+functions[zsh-defer] )); then - fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh + fpath+=( $ANTIDOTE_HOME/getantidote/zsh-defer ) + source $ANTIDOTE_HOME/getantidote/zsh-defer/zsh-defer.plugin.zsh fi -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-bar-SLASH-baz ) -zsh-defer -a source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-bar-SLASH-baz/baz.plugin.zsh +fpath+=( $ANTIDOTE_HOME/bar/baz ) +zsh-defer -a source $ANTIDOTE_HOME/bar/baz/baz.plugin.zsh % # cleanup % t_reset % @@ -166,8 +171,8 @@ zsh-defer -a source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ba ```zsh % antidote-script --path plugins/extract ohmy/ohmy | subenv ANTIDOTE_HOME -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/extract ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/extract/extract.plugin.zsh +fpath+=( $ANTIDOTE_HOME/ohmy/ohmy/plugins/extract ) +source $ANTIDOTE_HOME/ohmy/ohmy/plugins/extract/extract.plugin.zsh % ``` @@ -175,7 +180,7 @@ source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy ```zsh % antidote-script --path lib/lib1.zsh ohmy/ohmy | subenv ANTIDOTE_HOME -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib1.zsh +source $ANTIDOTE_HOME/ohmy/ohmy/lib/lib1.zsh % ``` @@ -183,10 +188,10 @@ source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy ```zsh % antidote-script --path lib ohmy/ohmy | subenv ANTIDOTE_HOME -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib1.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib2.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib3.zsh +fpath+=( $ANTIDOTE_HOME/ohmy/ohmy/lib ) +source $ANTIDOTE_HOME/ohmy/ohmy/lib/lib1.zsh +source $ANTIDOTE_HOME/ohmy/ohmy/lib/lib2.zsh +source $ANTIDOTE_HOME/ohmy/ohmy/lib/lib3.zsh % ``` @@ -194,7 +199,7 @@ source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy ```zsh % antidote-script --path themes/pretty.zsh-theme ohmy/ohmy | subenv ANTIDOTE_HOME -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/themes/pretty.zsh-theme +source $ANTIDOTE_HOME/ohmy/ohmy/themes/pretty.zsh-theme % ``` @@ -203,8 +208,8 @@ source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy ```zsh % antidote-script --conditional is-macos --path plugins/macos ohmy/ohmy | subenv ANTIDOTE_HOME if is-macos; then - fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/macos ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/macos/macos.plugin.zsh + fpath+=( $ANTIDOTE_HOME/ohmy/ohmy/plugins/macos ) + source $ANTIDOTE_HOME/ohmy/ohmy/plugins/macos/macos.plugin.zsh fi % ``` @@ -213,10 +218,10 @@ fi ```zsh % antidote-script --path plugins/macos --autoload functions ohmy/ohmy | subenv ANTIDOTE_HOME -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/macos/functions ) +fpath+=( $ANTIDOTE_HOME/ohmy/ohmy/plugins/macos/functions ) builtin autoload -Uz $fpath[-1]/*(N.:t) -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/macos ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/macos/macos.plugin.zsh +fpath+=( $ANTIDOTE_HOME/ohmy/ohmy/plugins/macos ) +source $ANTIDOTE_HOME/ohmy/ohmy/plugins/macos/macos.plugin.zsh % ``` @@ -225,12 +230,12 @@ source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy ```zsh % # append % antidote-script --fpath-rule append --path plugins/docker ohmy/ohmy | subenv ANTIDOTE_HOME -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/docker ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/docker/docker.plugin.zsh +fpath+=( $ANTIDOTE_HOME/ohmy/ohmy/plugins/docker ) +source $ANTIDOTE_HOME/ohmy/ohmy/plugins/docker/docker.plugin.zsh % # prepend % antidote-script --fpath-rule prepend --path plugins/docker ohmy/ohmy | subenv ANTIDOTE_HOME -fpath=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/docker $fpath ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/docker/docker.plugin.zsh +fpath=( $ANTIDOTE_HOME/ohmy/ohmy/plugins/docker $fpath ) +source $ANTIDOTE_HOME/ohmy/ohmy/plugins/docker/docker.plugin.zsh % # whoops % antidote-script --fpath-rule foobar --path plugins/docker ohmy/ohmy 2>&1 antidote: error: unexpected fpath rule: 'foobar' @@ -243,12 +248,12 @@ antidote: error: unexpected fpath rule: 'foobar' % # pre % antidote-script --pre run_before foo/bar | subenv ANTIDOTE_HOME run_before -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/bar.plugin.zsh +fpath+=( $ANTIDOTE_HOME/foo/bar ) +source $ANTIDOTE_HOME/foo/bar/bar.plugin.zsh % # post % antidote-script --post run_after foo/bar | subenv ANTIDOTE_HOME -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/bar.plugin.zsh +fpath+=( $ANTIDOTE_HOME/foo/bar ) +source $ANTIDOTE_HOME/foo/bar/bar.plugin.zsh run_after % ``` @@ -258,11 +263,11 @@ If a plugin is deferred, so is its post event % antidote-script --pre pre-event --post post-event --kind defer foo/bar | subenv ANTIDOTE_HOME pre-event if ! (( $+functions[zsh-defer] )); then - fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh + fpath+=( $ANTIDOTE_HOME/getantidote/zsh-defer ) + source $ANTIDOTE_HOME/getantidote/zsh-defer/zsh-defer.plugin.zsh fi -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar ) -zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/bar.plugin.zsh +fpath+=( $ANTIDOTE_HOME/foo/bar ) +zsh-defer source $ANTIDOTE_HOME/foo/bar/bar.plugin.zsh zsh-defer post-event % ``` diff --git a/tests/test_cmd_script_use.md b/tests/test_cmd_script_use.md deleted file mode 100644 index 88bfad4..0000000 --- a/tests/test_cmd_script_use.md +++ /dev/null @@ -1,16 +0,0 @@ -# antidote-script-use tests - -## Setup - -```zsh -% source ./tests/_setup.zsh -% source ./antidote.zsh -% -``` - -## Teardown - -```zsh -% t_teardown -% -``` diff --git a/tests/test_cmd_update.md b/tests/test_cmd_update.md index 88bde39..be16a09 100644 --- a/tests/test_cmd_update.md +++ b/tests/test_cmd_update.md @@ -13,11 +13,11 @@ ```zsh % antidote update Updating bundles... -antidote: checking for updates: git@github.com:baz/qux -antidote: checking for updates: https://github.com/bar/baz antidote: checking for updates: https://github.com/foo/bar +antidote: checking for updates: https://github.com/foo/baz +antidote: checking for updates: git@github.com:foo/qux +antidote: checking for updates: https://github.com/getantidote/zsh-defer antidote: checking for updates: https://github.com/ohmy/ohmy -antidote: checking for updates: https://github.com/romkatv/zsh-defer Waiting for bundle updates to complete... Bundle updates complete. @@ -25,7 +25,7 @@ Bundle updates complete. Updating antidote... antidote self-update complete. -antidote version 1.9.6 +antidote version 1.9.7 % ``` diff --git a/tests/test_fpath_rules.md b/tests/test_fpath_rules.md new file mode 100644 index 0000000..93b17d5 --- /dev/null +++ b/tests/test_fpath_rules.md @@ -0,0 +1,111 @@ +# antidote bundle fpath-rule: + +## Setup + +```zsh +% source ./tests/_setup.zsh +% source ./antidote.zsh +% +``` + +By default, fpath is appended to: + +```zsh +% antidote bundle foo/bar kind:fpath +fpath+=( $HOME/.cache/antidote/foo/bar ) +% +``` + +fpath can be told to explicitly append, but it's unnecessary + +```zsh +% antidote bundle foo/bar kind:zsh fpath-rule:append +fpath+=( $HOME/.cache/antidote/foo/bar ) +source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh +% + +fpath can be prepended with fpath-rule:prepend + +```zsh +% antidote bundle foo/bar kind:fpath fpath-rule:prepend +fpath=( $HOME/.cache/antidote/foo/bar $fpath ) +% + +fpath rules can only be append/prepend + +```zsh +% antidote bundle foo/bar kind:fpath fpath-rule:append #=> --exit 0 +% antidote bundle foo/bar kind:fpath fpath-rule:prepend #=> --exit 0 +% antidote bundle foo/bar kind:fpath fpath-rule:foo 2>&1 +antidote: error: unexpected fpath rule: 'foo' +% + +fpath rules are also used for `kind:autoload` + +```zsh +% antidote bundle foo/baz path:baz kind:autoload fpath-rule:append +fpath+=( $HOME/.cache/antidote/foo/baz/baz ) +builtin autoload -Uz $fpath[-1]/*(N.:t) +% antidote bundle foo/baz path:baz kind:autoload fpath-rule:prepend +fpath=( $HOME/.cache/antidote/foo/baz/baz $fpath ) +builtin autoload -Uz $fpath[1]/*(N.:t) +% +``` + +fpath rules are also used for `autoload:funcdir` + +```zsh +% # Append +% antidote bundle foo/baz autoload:baz fpath-rule:append +fpath+=( $HOME/.cache/antidote/foo/baz/baz ) +builtin autoload -Uz $fpath[-1]/*(N.:t) +fpath+=( $HOME/.cache/antidote/foo/baz ) +source $HOME/.cache/antidote/foo/baz/baz.plugin.zsh +% # Prepend +% antidote bundle foo/baz autoload:baz fpath-rule:prepend +fpath=( $HOME/.cache/antidote/foo/baz/baz $fpath ) +builtin autoload -Uz $fpath[1]/*(N.:t) +fpath=( $HOME/.cache/antidote/foo/baz $fpath ) +source $HOME/.cache/antidote/foo/baz/baz.plugin.zsh +% +``` + +fpath rules can be set globally with a zstyle: + +`zstyle ':antidote:fpath' rule 'prepend'` + +```zsh +% zstyle ':antidote:fpath' rule 'prepend' +% antidote bundle foo/bar +fpath=( $HOME/.cache/antidote/foo/bar $fpath ) +source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh +% antidote bundle foo/bar kind:fpath +fpath=( $HOME/.cache/antidote/foo/bar $fpath ) +% antidote bundle foo/baz path:baz kind:autoload +fpath=( $HOME/.cache/antidote/foo/baz/baz $fpath ) +builtin autoload -Uz $fpath[1]/*(N.:t) +% +``` + +It is NOT recommended to do this, but if you choose to then explicit fpath-rules are +still respected: + +```zsh +% zstyle ':antidote:fpath' rule 'prepend' +% antidote bundle foo/bar fpath-rule:append +fpath+=( $HOME/.cache/antidote/foo/bar ) +source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh +% antidote bundle foo/bar kind:fpath fpath-rule:append +fpath+=( $HOME/.cache/antidote/foo/bar ) +% antidote bundle foo/baz path:baz kind:autoload fpath-rule:append +fpath+=( $HOME/.cache/antidote/foo/baz/baz ) +builtin autoload -Uz $fpath[-1]/*(N.:t) +% +``` + +## Teardown + +```zsh +% t_teardown +% +``` diff --git a/tests/test_helpers.md b/tests/test_helpers.md index 03266bd..6234cbb 100644 --- a/tests/test_helpers.md +++ b/tests/test_helpers.md @@ -8,6 +8,30 @@ % ``` +## Safe removal + +Appease my paranoia and ensure that you can't remove a path you shouldn't be able to: + +```zsh +% __antidote_del -rf -- /foo/bar +antidote: Blocked attempt to rm path: '/foo/bar'. +% +``` + +## Pretty print path + +```zsh +% __antidote_print_path /foo/bar +/foo/bar +% __antidote_print_path $HOME/foo/bar +$HOME/foo/bar +% zstyle ':antidote:compatibility-mode' 'antibody' 'on' +% __antidote_print_path $HOME/foo/bar | subenv T_TEMPDIR +$T_TEMPDIR/foo/bar +% zstyle -d ':antidote:compatibility-mode' 'antibody' +% +``` + ## Bundle type ```zsh @@ -106,6 +130,7 @@ foo bar baz ## Bundle dir ```zsh +% zstyle ':antidote:bundle' use-friendly-names off % # short repo % __antidote_bundle_dir foo/bar | subenv ANTIDOTE_HOME $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar @@ -138,8 +163,8 @@ $ANTIDOTE_HOME/foo/bar % __antidote_bundle_dir https://github.com/bar/baz | subenv ANTIDOTE_HOME $ANTIDOTE_HOME/bar/baz % # ssh repo - friendly name -% __antidote_bundle_dir git@github.com:baz/qux.git | subenv ANTIDOTE_HOME -$ANTIDOTE_HOME/baz/qux +% __antidote_bundle_dir git@github.com:foo/qux.git | subenv ANTIDOTE_HOME +$ANTIDOTE_HOME/foo/qux % ``` @@ -180,14 +205,14 @@ git@github.com:sindresorhus/pure.git If we \ --file zdotdir/.zsh_plugins.txt +% __antidote_collect_input <$ZDOTDIR/.zsh_plugins.txt #=> --file tmp_home/.zsh/.zsh_plugins.txt % ``` If we \|pipe input it should output that. ```zsh -% cat $ZDOTDIR/.zsh_plugins.txt | __antidote_collect_input #=> --file zdotdir/.zsh_plugins.txt +% cat $ZDOTDIR/.zsh_plugins.txt | __antidote_collect_input #=> --file tmp_home/.zsh/.zsh_plugins.txt % ``` diff --git a/tests/test_real.md b/tests/test_real.md index 8f6f7f8..f826b10 100644 --- a/tests/test_real.md +++ b/tests/test_real.md @@ -57,7 +57,7 @@ Test that everything updated Check to see that branch:br annotations properly changed the cloned branch ```zsh -% branched_plugin="$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-mattmc3-SLASH-antidote" +% branched_plugin="$ANTIDOTE_HOME/mattmc3/antidote" % git -C $branched_plugin branch --show-current 2>/dev/null pz % @@ -115,16 +115,16 @@ Clone and generate bundle script ```zsh % antidote bundle <$TESTDATA/.zsh_plugins.crlf.txt >$ZDOTDIR/.zsh_plugins.zsh 2>/dev/null % cat $ZDOTDIR/.zsh_plugins.zsh | subenv ANTIDOTE_HOME -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-rupa-SLASH-z ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-rupa-SLASH-z/z.sh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-syntax-highlighting ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-completions ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-completions/zsh-completions.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-autosuggestions ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-autosuggestions/zsh-autosuggestions.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-history-substring-search ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-history-substring-search/zsh-history-substring-search.plugin.zsh +fpath+=( $ANTIDOTE_HOME/rupa/z ) +source $ANTIDOTE_HOME/rupa/z/z.sh +fpath+=( $ANTIDOTE_HOME/zsh-users/zsh-syntax-highlighting ) +source $ANTIDOTE_HOME/zsh-users/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh +fpath+=( $ANTIDOTE_HOME/zsh-users/zsh-completions ) +source $ANTIDOTE_HOME/zsh-users/zsh-completions/zsh-completions.plugin.zsh +fpath+=( $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions ) +source $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh +fpath+=( $ANTIDOTE_HOME/zsh-users/zsh-history-substring-search ) +source $ANTIDOTE_HOME/zsh-users/zsh-history-substring-search/zsh-history-substring-search.plugin.zsh % ``` @@ -132,11 +132,11 @@ Check to see that everything cloned ```zsh % antidote list | subenv ANTIDOTE_HOME -https://github.com/rupa/z $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-rupa-SLASH-z -https://github.com/zsh-users/zsh-autosuggestions $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-autosuggestions -https://github.com/zsh-users/zsh-completions $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-completions -https://github.com/zsh-users/zsh-history-substring-search $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-history-substring-search -https://github.com/zsh-users/zsh-syntax-highlighting $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-syntax-highlighting +https://github.com/rupa/z $ANTIDOTE_HOME/rupa/z +https://github.com/zsh-users/zsh-autosuggestions $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions +https://github.com/zsh-users/zsh-completions $ANTIDOTE_HOME/zsh-users/zsh-completions +https://github.com/zsh-users/zsh-history-substring-search $ANTIDOTE_HOME/zsh-users/zsh-history-substring-search +https://github.com/zsh-users/zsh-syntax-highlighting $ANTIDOTE_HOME/zsh-users/zsh-syntax-highlighting % ``` diff --git a/tests/test_zcompile_bundle.md b/tests/test_zcompile_bundle.md index 6162abb..94cdbab 100644 --- a/tests/test_zcompile_bundle.md +++ b/tests/test_zcompile_bundle.md @@ -15,10 +15,10 @@ Ensure a compiled file does not exist: ```zsh % zstyle ':antidote:bundle:*' zcompile 'no' % ! test -e $ZDOTDIR/custom/lib/lib1.zsh.zwc #=> --exit 0 -% antidote bundle $ZDOTDIR/custom/lib/lib1.zsh | subenv +% antidote bundle $ZDOTDIR/custom/lib/lib1.zsh | subenv ZDOTDIR source $ZDOTDIR/custom/lib/lib1.zsh % ! test -e $ZDOTDIR/custom/lib/lib1.zsh.zwc #=> --exit 0 -% antidote bundle $ZDOTDIR/custom/plugins/mytheme | subenv +% antidote bundle $ZDOTDIR/custom/plugins/mytheme | subenv ZDOTDIR fpath+=( $ZDOTDIR/custom/plugins/mytheme ) source $ZDOTDIR/custom/plugins/mytheme/mytheme.zsh-theme % ! test -e $ZDOTDIR/custom/plugins/mytheme/mytheme.zsh-theme.zwc #=> --exit 0 @@ -30,16 +30,16 @@ Ensure a compiled file exists: ```zsh % zstyle ':antidote:bundle:*' zcompile 'yes' % ! test -e $ZDOTDIR/custom/lib/lib2.zsh.zwc #=> --exit 0 -% antidote bundle $ZDOTDIR/custom/lib/lib2.zsh | subenv +% antidote bundle $ZDOTDIR/custom/lib/lib2.zsh | subenv ZDOTDIR source $ZDOTDIR/custom/lib/lib2.zsh % test -e $ZDOTDIR/custom/lib/lib2.zsh.zwc #=> --exit 0 % # plugin -% antidote bundle $ZDOTDIR/custom/plugins/myplugin | subenv +% antidote bundle $ZDOTDIR/custom/plugins/myplugin | subenv ZDOTDIR fpath+=( $ZDOTDIR/custom/plugins/myplugin ) source $ZDOTDIR/custom/plugins/myplugin/myplugin.plugin.zsh % test -e $ZDOTDIR/custom/plugins/myplugin/myplugin.plugin.zsh.zwc #=> --exit 0 % # zsh-theme -% antidote bundle $ZDOTDIR/custom/plugins/mytheme | subenv +% antidote bundle $ZDOTDIR/custom/plugins/mytheme | subenv ZDOTDIR fpath+=( $ZDOTDIR/custom/plugins/mytheme ) source $ZDOTDIR/custom/plugins/mytheme/mytheme.zsh-theme % test -e $ZDOTDIR/custom/plugins/mytheme/mytheme.zsh-theme.zwc #=> --exit 0 diff --git a/tests/test_zsetopts.md b/tests/test_zsetopts.md index b8d3b38..89a384c 100644 --- a/tests/test_zsetopts.md +++ b/tests/test_zsetopts.md @@ -10,11 +10,11 @@ Set up a plugin that changes Zsh options ```zsh -% plugin_file=$ZDOTDIR/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/bar.plugin.zsh +% plugin_file=$ANTIDOTE_HOME/lampoon/xmas/xmas.plugin.zsh % mkdir -p $plugin_file:h && touch $plugin_file % echo "unsetopt noaliases" >>$plugin_file % echo "setopt autocd" >>$plugin_file -% echo "foo/bar" >$ZDOTDIR/.zsh_plugins.txt +% echo "lampoon/xmas" >$ZDOTDIR/.zsh_plugins.txt % ``` diff --git a/tests/testdata/.zplugins_fake_load.zsh b/tests/testdata/.zplugins_fake_load.zsh index 7f3793e..cca0386 100644 --- a/tests/testdata/.zplugins_fake_load.zsh +++ b/tests/testdata/.zplugins_fake_load.zsh @@ -1,25 +1,25 @@ -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/bar.plugin.zsh -fpath+=( $ANTIDOTE_HOME/git-AT-github.aaakk.us.kg-COLON-baz-SLASH-qux ) -source $ANTIDOTE_HOME/git-AT-github.aaakk.us.kg-COLON-baz-SLASH-qux/qux.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/bar.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar ) -export PATH="$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar:$PATH" -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib1.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib2.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib3.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/extract ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/extract/extract.plugin.zsh -fpath=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/docker $fpath ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/docker/docker.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/docker ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/docker/docker.plugin.zsh +fpath+=( $HOME/.cache/antidote/foo/bar ) +source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh +fpath+=( $HOME/.cache/antidote/foo/qux ) +source $HOME/.cache/antidote/foo/qux/qux.plugin.zsh +fpath+=( $HOME/.cache/antidote/foo/bar ) +source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh +fpath+=( $HOME/.cache/antidote/foo/bar ) +export PATH="$HOME/.cache/antidote/foo/bar:$PATH" +fpath+=( $HOME/.cache/antidote/ohmy/ohmy/lib ) +source $HOME/.cache/antidote/ohmy/ohmy/lib/lib1.zsh +source $HOME/.cache/antidote/ohmy/ohmy/lib/lib2.zsh +source $HOME/.cache/antidote/ohmy/ohmy/lib/lib3.zsh +fpath+=( $HOME/.cache/antidote/ohmy/ohmy/plugins/extract ) +source $HOME/.cache/antidote/ohmy/ohmy/plugins/extract/extract.plugin.zsh +fpath=( $HOME/.cache/antidote/ohmy/ohmy/plugins/docker $fpath ) +source $HOME/.cache/antidote/ohmy/ohmy/plugins/docker/docker.plugin.zsh +fpath+=( $HOME/.cache/antidote/ohmy/ohmy/plugins/docker ) +source $HOME/.cache/antidote/ohmy/ohmy/plugins/docker/docker.plugin.zsh if ! (( $+functions[zsh-defer] )); then - fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh + fpath+=( $HOME/.cache/antidote/getantidote/zsh-defer ) + source $HOME/.cache/antidote/getantidote/zsh-defer/zsh-defer.plugin.zsh fi -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter ) -zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter/magic-enter.plugin.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/custom/themes/pretty.zsh-theme +fpath+=( $HOME/.cache/antidote/ohmy/ohmy/plugins/magic-enter ) +zsh-defer source $HOME/.cache/antidote/ohmy/ohmy/plugins/magic-enter/magic-enter.plugin.zsh +source $HOME/.cache/antidote/ohmy/ohmy/custom/themes/pretty.zsh-theme diff --git a/tests/testdata/.zplugins_fake_zcompile_static.zsh b/tests/testdata/.zplugins_fake_zcompile_static.zsh index 3381bf7..922326a 100644 --- a/tests/testdata/.zplugins_fake_zcompile_static.zsh +++ b/tests/testdata/.zplugins_fake_zcompile_static.zsh @@ -7,28 +7,28 @@ function { zrecompile -pq ${staticfile} fi } -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/bar.plugin.zsh -fpath+=( $ANTIDOTE_HOME/git-AT-github.aaakk.us.kg-COLON-baz-SLASH-qux ) -source $ANTIDOTE_HOME/git-AT-github.aaakk.us.kg-COLON-baz-SLASH-qux/qux.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/bar.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar ) -export PATH="$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar:$PATH" -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib1.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib2.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib3.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/extract ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/extract/extract.plugin.zsh -fpath=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/docker $fpath ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/docker/docker.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/docker ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/docker/docker.plugin.zsh +fpath+=( $HOME/.cache/antidote/foo/bar ) +source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh +fpath+=( $HOME/.cache/antidote/foo/qux ) +source $HOME/.cache/antidote/foo/qux/qux.plugin.zsh +fpath+=( $HOME/.cache/antidote/foo/bar ) +source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh +fpath+=( $HOME/.cache/antidote/foo/bar ) +export PATH="$HOME/.cache/antidote/foo/bar:$PATH" +fpath+=( $HOME/.cache/antidote/ohmy/ohmy/lib ) +source $HOME/.cache/antidote/ohmy/ohmy/lib/lib1.zsh +source $HOME/.cache/antidote/ohmy/ohmy/lib/lib2.zsh +source $HOME/.cache/antidote/ohmy/ohmy/lib/lib3.zsh +fpath+=( $HOME/.cache/antidote/ohmy/ohmy/plugins/extract ) +source $HOME/.cache/antidote/ohmy/ohmy/plugins/extract/extract.plugin.zsh +fpath=( $HOME/.cache/antidote/ohmy/ohmy/plugins/docker $fpath ) +source $HOME/.cache/antidote/ohmy/ohmy/plugins/docker/docker.plugin.zsh +fpath+=( $HOME/.cache/antidote/ohmy/ohmy/plugins/docker ) +source $HOME/.cache/antidote/ohmy/ohmy/plugins/docker/docker.plugin.zsh if ! (( $+functions[zsh-defer] )); then - fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh + fpath+=( $HOME/.cache/antidote/getantidote/zsh-defer ) + source $HOME/.cache/antidote/getantidote/zsh-defer/zsh-defer.plugin.zsh fi -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter ) -zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter/magic-enter.plugin.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/custom/themes/pretty.zsh-theme +fpath+=( $HOME/.cache/antidote/ohmy/ohmy/plugins/magic-enter ) +zsh-defer source $HOME/.cache/antidote/ohmy/ohmy/plugins/magic-enter/magic-enter.plugin.zsh +source $HOME/.cache/antidote/ohmy/ohmy/custom/themes/pretty.zsh-theme diff --git a/tests/testdata/.zsh_plugins.zsh b/tests/testdata/.zsh_plugins.zsh index a7c20dd..75188da 100644 --- a/tests/testdata/.zsh_plugins.zsh +++ b/tests/testdata/.zsh_plugins.zsh @@ -1,27 +1,25 @@ fpath+=( $HOME/foo/bar ) source $HOME/foo/bar/bar.plugin.zsh -fpath+=( $ZDOTDIR/foo/bar ) -source $ZDOTDIR/foo/bar/bar.plugin.zsh -fpath+=( $ZDOTDIR/foo/bar/baz ) -source $ZDOTDIR/foo/bar/baz/baz.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/bar.plugin.zsh -fpath+=( $ANTIDOTE_HOME/git-AT-github.aaakk.us.kg-COLON-baz-SLASH-qux ) -source $ANTIDOTE_HOME/git-AT-github.aaakk.us.kg-COLON-baz-SLASH-qux/qux.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/bar.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar ) -export PATH="$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar:$PATH" -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib1.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib2.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib3.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/extract ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/extract/extract.plugin.zsh +fpath+=( $ZSH_CUSTOM/plugins/myplugin ) +source $ZSH_CUSTOM/plugins/myplugin/myplugin.plugin.zsh +fpath+=( $HOME/.cache/antidote/foo/bar ) +source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh +fpath+=( $HOME/.cache/antidote/foo/qux ) +source $HOME/.cache/antidote/foo/qux/qux.plugin.zsh +fpath+=( $HOME/.cache/antidote/foo/bar ) +source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh +fpath+=( $HOME/.cache/antidote/foo/bar ) +export PATH="$HOME/.cache/antidote/foo/bar:$PATH" +fpath+=( $HOME/.cache/antidote/ohmy/ohmy/lib ) +source $HOME/.cache/antidote/ohmy/ohmy/lib/lib1.zsh +source $HOME/.cache/antidote/ohmy/ohmy/lib/lib2.zsh +source $HOME/.cache/antidote/ohmy/ohmy/lib/lib3.zsh +fpath+=( $HOME/.cache/antidote/ohmy/ohmy/plugins/extract ) +source $HOME/.cache/antidote/ohmy/ohmy/plugins/extract/extract.plugin.zsh if ! (( $+functions[zsh-defer] )); then - fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh + fpath+=( $HOME/.cache/antidote/getantidote/zsh-defer ) + source $HOME/.cache/antidote/getantidote/zsh-defer/zsh-defer.plugin.zsh fi -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter ) -zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter/magic-enter.plugin.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/custom/themes/pretty.zsh-theme +fpath+=( $HOME/.cache/antidote/ohmy/ohmy/plugins/magic-enter ) +zsh-defer source $HOME/.cache/antidote/ohmy/ohmy/plugins/magic-enter/magic-enter.plugin.zsh +source $HOME/.cache/antidote/ohmy/ohmy/custom/themes/pretty.zsh-theme diff --git a/tests/testdata/.zsh_plugins_multi_defer.zsh b/tests/testdata/.zsh_plugins_multi_defer.zsh index 864ce7f..f333e7b 100644 --- a/tests/testdata/.zsh_plugins_multi_defer.zsh +++ b/tests/testdata/.zsh_plugins_multi_defer.zsh @@ -1,8 +1,8 @@ fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-history-substring-search ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-history-substring-search/zsh-history-substring-search.plugin.zsh if ! (( $+functions[zsh-defer] )); then - fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh + fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-getantidote-SLASH-zsh-defer ) + source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-getantidote-SLASH-zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-syntax-highlighting ) zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh @@ -11,14 +11,14 @@ if is-macos; then source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/macos/macos.plugin.zsh fi if ! (( $+functions[zsh-defer] )); then - fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh + fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-getantidote-SLASH-zsh-defer ) + source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-getantidote-SLASH-zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-autosuggestions ) zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-autosuggestions/zsh-autosuggestions.plugin.zsh if ! (( $+functions[zsh-defer] )); then - fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh + fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-getantidote-SLASH-zsh-defer ) + source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-getantidote-SLASH-zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zdharma-continuum-SLASH-fast-syntax-highlighting ) zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zdharma-continuum-SLASH-fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh diff --git a/tests/testdata/.zsh_plugins_purged.txt b/tests/testdata/.zsh_plugins_purged.txt index 298f59d..355d80f 100644 --- a/tests/testdata/.zsh_plugins_purged.txt +++ b/tests/testdata/.zsh_plugins_purged.txt @@ -1,14 +1,13 @@ # local plugins ~/foo/bar -$ZDOTDIR/foo/bar -$ZDOTDIR/foo/bar path:baz +$ZSH_CUSTOM path:plugins/myplugin # repo plugins # foo/bar -git@github.com:baz/qux.git # trailing comments +git@github.com:foo/qux.git # trailing comments # kind:clone -romkatv/zsh-defer kind:clone # more trailing comments +getantidote/zsh-defer kind:clone # more trailing comments # kind:zsh # foo/bar kind:zsh diff --git a/tests/testdata/.zsh_plugins_repos.txt b/tests/testdata/.zsh_plugins_repos.txt index 894bb55..c23a74d 100644 --- a/tests/testdata/.zsh_plugins_repos.txt +++ b/tests/testdata/.zsh_plugins_repos.txt @@ -17,8 +17,8 @@ bar/baz path:themes/qux.zsh-theme foobar/foobar branch:baz # defer -https://github.com/baz/qux kind:defer -https://github.com/qux/baz kind:defer +https://github.com/foo/qux kind:defer +https://github.com/foo/baz kind:defer # non repos foo diff --git a/tests/testdata/real/.zsh_plugins.zsh b/tests/testdata/real/.zsh_plugins.zsh index 0ee0a6b..17b16bb 100644 --- a/tests/testdata/real/.zsh_plugins.zsh +++ b/tests/testdata/real/.zsh_plugins.zsh @@ -1,43 +1,43 @@ fpath+=( $ZSH_CUSTOM/plugins/myplugin ) source $ZSH_CUSTOM/plugins/myplugin/myplugin.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-history-substring-search ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-history-substring-search/zsh-history-substring-search.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-autosuggestions ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-autosuggestions/zsh-autosuggestions.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-syntax-highlighting ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-sindresorhus-SLASH-pure ) -export PATH="$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-bench:$PATH" -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-mattmc3-SLASH-zman/functions ) +fpath+=( $ANTIDOTE_HOME/zsh-users/zsh-history-substring-search ) +source $ANTIDOTE_HOME/zsh-users/zsh-history-substring-search/zsh-history-substring-search.plugin.zsh +fpath+=( $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions ) +source $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh +fpath+=( $ANTIDOTE_HOME/zsh-users/zsh-syntax-highlighting ) +source $ANTIDOTE_HOME/zsh-users/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh +fpath+=( $ANTIDOTE_HOME/sindresorhus/pure ) +export PATH="$ANTIDOTE_HOME/romkatv/zsh-bench:$PATH" +fpath+=( $ANTIDOTE_HOME/mattmc3/zman/functions ) builtin autoload -Uz $fpath[-1]/*(N.:t) -fpath=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/gradle $fpath ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/gradle/gradle.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/docker ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/docker/docker.plugin.zsh +fpath=( $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/gradle $fpath ) +source $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/gradle/gradle.plugin.zsh +fpath+=( $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/docker ) +source $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/docker/docker.plugin.zsh if is-macos; then - fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/macos ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/macos/macos.plugin.zsh + fpath+=( $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/macos ) + source $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/macos/macos.plugin.zsh fi -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-mattmc3-SLASH-antidote ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-mattmc3-SLASH-antidote/pz.plugin.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/clipboard.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/extract ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/extract/extract.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/magic-enter ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/magic-enter/magic-enter.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/fancy-ctrl-z ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh +fpath+=( $ANTIDOTE_HOME/mattmc3/antidote ) +source $ANTIDOTE_HOME/mattmc3/antidote/pz.plugin.zsh +source $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/lib/clipboard.zsh +fpath+=( $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/extract ) +source $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/extract/extract.plugin.zsh +fpath+=( $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/magic-enter ) +source $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/magic-enter/magic-enter.plugin.zsh +fpath+=( $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/fancy-ctrl-z ) +source $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh if ! (( $+functions[zsh-defer] )); then - fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh + fpath+=( $ANTIDOTE_HOME/romkatv/zsh-defer ) + source $ANTIDOTE_HOME/romkatv/zsh-defer/zsh-defer.plugin.zsh fi -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zdharma-continuum-SLASH-fast-syntax-highlighting ) -zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zdharma-continuum-SLASH-fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-dracula-SLASH-zsh ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-dracula-SLASH-zsh/dracula.zsh-theme -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-peterhurford-SLASH-up.zsh ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-peterhurford-SLASH-up.zsh/up.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-rummik-SLASH-zsh-tailf ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-rummik-SLASH-zsh-tailf/tailf.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-rupa-SLASH-z ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-rupa-SLASH-z/z.sh +fpath+=( $ANTIDOTE_HOME/zdharma-continuum/fast-syntax-highlighting ) +zsh-defer source $ANTIDOTE_HOME/zdharma-continuum/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh +fpath+=( $ANTIDOTE_HOME/dracula/zsh ) +source $ANTIDOTE_HOME/dracula/zsh/dracula.zsh-theme +fpath+=( $ANTIDOTE_HOME/peterhurford/up.zsh ) +source $ANTIDOTE_HOME/peterhurford/up.zsh/up.plugin.zsh +fpath+=( $ANTIDOTE_HOME/rummik/zsh-tailf ) +source $ANTIDOTE_HOME/rummik/zsh-tailf/tailf.plugin.zsh +fpath+=( $ANTIDOTE_HOME/rupa/z ) +source $ANTIDOTE_HOME/rupa/z/z.sh diff --git a/tests/testdata/real/repo-list.txt b/tests/testdata/real/repo-list.txt index 84b8a36..1bac45f 100644 --- a/tests/testdata/real/repo-list.txt +++ b/tests/testdata/real/repo-list.txt @@ -1,15 +1,15 @@ -https://github.com/dracula/zsh $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-dracula-SLASH-zsh -https://github.com/mattmc3/antidote $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-mattmc3-SLASH-antidote -https://github.com/mattmc3/zman $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-mattmc3-SLASH-zman -https://github.com/ohmyzsh/ohmyzsh $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmyzsh-SLASH-ohmyzsh -https://github.com/peterhurford/up.zsh $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-peterhurford-SLASH-up.zsh -https://github.com/romkatv/zsh-bench $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-bench -https://github.com/romkatv/zsh-defer $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer -https://github.com/rummik/zsh-tailf $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-rummik-SLASH-zsh-tailf -https://github.com/rupa/z $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-rupa-SLASH-z -https://github.com/sindresorhus/pure $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-sindresorhus-SLASH-pure -https://github.com/zdharma-continuum/fast-syntax-highlighting $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zdharma-continuum-SLASH-fast-syntax-highlighting -https://github.com/zsh-users/antigen $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-antigen -https://github.com/zsh-users/zsh-autosuggestions $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-autosuggestions -https://github.com/zsh-users/zsh-history-substring-search $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-history-substring-search -https://github.com/zsh-users/zsh-syntax-highlighting $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-zsh-users-SLASH-zsh-syntax-highlighting +https://github.com/dracula/zsh $ANTIDOTE_HOME/dracula/zsh +https://github.com/mattmc3/antidote $ANTIDOTE_HOME/mattmc3/antidote +https://github.com/mattmc3/zman $ANTIDOTE_HOME/mattmc3/zman +https://github.com/ohmyzsh/ohmyzsh $ANTIDOTE_HOME/ohmyzsh/ohmyzsh +https://github.com/peterhurford/up.zsh $ANTIDOTE_HOME/peterhurford/up.zsh +https://github.com/romkatv/zsh-bench $ANTIDOTE_HOME/romkatv/zsh-bench +https://github.com/romkatv/zsh-defer $ANTIDOTE_HOME/romkatv/zsh-defer +https://github.com/rummik/zsh-tailf $ANTIDOTE_HOME/rummik/zsh-tailf +https://github.com/rupa/z $ANTIDOTE_HOME/rupa/z +https://github.com/sindresorhus/pure $ANTIDOTE_HOME/sindresorhus/pure +https://github.com/zdharma-continuum/fast-syntax-highlighting $ANTIDOTE_HOME/zdharma-continuum/fast-syntax-highlighting +https://github.com/zsh-users/antigen $ANTIDOTE_HOME/zsh-users/antigen +https://github.com/zsh-users/zsh-autosuggestions $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions +https://github.com/zsh-users/zsh-history-substring-search $ANTIDOTE_HOME/zsh-users/zsh-history-substring-search +https://github.com/zsh-users/zsh-syntax-highlighting $ANTIDOTE_HOME/zsh-users/zsh-syntax-highlighting diff --git a/tests/testdata/script-bazqux.zsh b/tests/testdata/script-bazqux.zsh deleted file mode 100644 index e5a5d05..0000000 --- a/tests/testdata/script-bazqux.zsh +++ /dev/null @@ -1,2 +0,0 @@ -fpath+=( $ANTIDOTE_HOME/git-AT-github.aaakk.us.kg-COLON-baz-SLASH-qux ) -source $ANTIDOTE_HOME/git-AT-github.aaakk.us.kg-COLON-baz-SLASH-qux/qux.plugin.zsh diff --git a/tests/testdata/script-fooqux.zsh b/tests/testdata/script-fooqux.zsh new file mode 100644 index 0000000..019484f --- /dev/null +++ b/tests/testdata/script-fooqux.zsh @@ -0,0 +1,2 @@ +fpath+=( $ANTIDOTE_HOME/git-AT-github.aaakk.us.kg-COLON-foo-SLASH-qux ) +source $ANTIDOTE_HOME/git-AT-github.aaakk.us.kg-COLON-foo-SLASH-qux/qux.plugin.zsh diff --git a/tests/zdotdir/antidote_home/git-AT-github.aaakk.us.kg-COLON-baz-SLASH-qux/.mockgit/.gitkeep b/tests/tmp_home/.cache/antibody/git-AT-github.aaakk.us.kg-COLON-foo-SLASH-qux/.mockgit/.gitkeep similarity index 100% rename from tests/zdotdir/antidote_home/git-AT-github.aaakk.us.kg-COLON-baz-SLASH-qux/.mockgit/.gitkeep rename to tests/tmp_home/.cache/antibody/git-AT-github.aaakk.us.kg-COLON-foo-SLASH-qux/.mockgit/.gitkeep diff --git a/tests/tmp_home/.cache/antibody/git-AT-github.aaakk.us.kg-COLON-foo-SLASH-qux/qux.plugin.zsh b/tests/tmp_home/.cache/antibody/git-AT-github.aaakk.us.kg-COLON-foo-SLASH-qux/qux.plugin.zsh new file mode 100644 index 0000000..ef59ec0 --- /dev/null +++ b/tests/tmp_home/.cache/antibody/git-AT-github.aaakk.us.kg-COLON-foo-SLASH-qux/qux.plugin.zsh @@ -0,0 +1,2 @@ +echo "sourcing foo/qux..." +plugins=($plugins foo/qux) diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-bar-SLASH-baz/.mockgit/.gitkeep b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/.mockgit/.gitkeep similarity index 100% rename from tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-bar-SLASH-baz/.mockgit/.gitkeep rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/.mockgit/.gitkeep diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/bar.plugin.zsh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/bar.plugin.zsh similarity index 100% rename from tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/bar.plugin.zsh rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/bar.plugin.zsh diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/.mockgit/.gitkeep b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-baz/.mockgit/.gitkeep similarity index 100% rename from tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-bar/.mockgit/.gitkeep rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-baz/.mockgit/.gitkeep diff --git a/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-baz/baz.plugin.zsh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-baz/baz.plugin.zsh new file mode 100644 index 0000000..7de75c6 --- /dev/null +++ b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-baz/baz.plugin.zsh @@ -0,0 +1,2 @@ +echo "sourcing foo/baz..." +plugins=($plugins foo/baz) diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-bar-SLASH-baz/functions/_baz b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-baz/functions/_baz similarity index 100% rename from tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-bar-SLASH-baz/functions/_baz rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-baz/functions/_baz diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-bar-SLASH-baz/functions/baz b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-baz/functions/baz similarity index 100% rename from tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-bar-SLASH-baz/functions/baz rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-foo-SLASH-baz/functions/baz diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/.mockgit/.gitkeep b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-getantidote-SLASH-zsh-defer/.mockgit/.gitkeep similarity index 100% rename from tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/.mockgit/.gitkeep rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-getantidote-SLASH-zsh-defer/.mockgit/.gitkeep diff --git a/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-getantidote-SLASH-zsh-defer/zsh-defer.plugin.zsh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-getantidote-SLASH-zsh-defer/zsh-defer.plugin.zsh new file mode 100644 index 0000000..20a8508 --- /dev/null +++ b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-getantidote-SLASH-zsh-defer/zsh-defer.plugin.zsh @@ -0,0 +1,6 @@ +# fake foo/bar +echo "sourcing getantidote/zsh-defer..." +plugins=($plugins getantidote/zsh-defer) +function zsh-defer { + $@ +} diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer/.mockgit/.gitkeep b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/.mockgit/.gitkeep similarity index 100% rename from tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer/.mockgit/.gitkeep rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/.mockgit/.gitkeep diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/custom/themes/pretty.zsh-theme b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/custom/themes/pretty.zsh-theme similarity index 100% rename from tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/custom/themes/pretty.zsh-theme rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/custom/themes/pretty.zsh-theme diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/custom/themes/ugly.zsh-theme b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/custom/themes/ugly.zsh-theme similarity index 100% rename from tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/custom/themes/ugly.zsh-theme rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/custom/themes/ugly.zsh-theme diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib1.zsh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib1.zsh similarity index 100% rename from tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib1.zsh rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib1.zsh diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib2.zsh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib2.zsh similarity index 100% rename from tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib2.zsh rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib2.zsh diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib3.zsh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib3.zsh similarity index 100% rename from tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib3.zsh rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/lib/lib3.zsh diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/oh-my.sh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/oh-my.sh similarity index 100% rename from tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/oh-my.sh rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/oh-my.sh diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/docker/_docker b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/docker/_docker similarity index 100% rename from tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/docker/_docker rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/docker/_docker diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/docker/docker.plugin.zsh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/docker/docker.plugin.zsh similarity index 100% rename from tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/docker/docker.plugin.zsh rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/docker/docker.plugin.zsh diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/extract/extract.plugin.zsh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/extract/extract.plugin.zsh similarity index 100% rename from tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/extract/extract.plugin.zsh rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/extract/extract.plugin.zsh diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/macos/functions/macos_func b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/macos/functions/macos_func similarity index 100% rename from tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/macos/functions/macos_func rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/macos/functions/macos_func diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/macos/macos.plugin.zsh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/macos/macos.plugin.zsh similarity index 100% rename from tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/macos/macos.plugin.zsh rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/macos/macos.plugin.zsh diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter/magic-enter.plugin.zsh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter/magic-enter.plugin.zsh similarity index 100% rename from tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter/magic-enter.plugin.zsh rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter/magic-enter.plugin.zsh diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/themes/pretty.zsh-theme b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/themes/pretty.zsh-theme similarity index 100% rename from tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/themes/pretty.zsh-theme rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-ohmy-SLASH-ohmy/themes/pretty.zsh-theme diff --git a/tests/tmp_home/.cache/antidote/foo/bar/.mockgit/config/remote.origin.url b/tests/tmp_home/.cache/antidote/foo/bar/.mockgit/config/remote.origin.url new file mode 100644 index 0000000..d39cfca --- /dev/null +++ b/tests/tmp_home/.cache/antidote/foo/bar/.mockgit/config/remote.origin.url @@ -0,0 +1 @@ +https://github.com/foo/bar diff --git a/tests/tmp_home/.cache/antidote/foo/bar/bar.plugin.zsh b/tests/tmp_home/.cache/antidote/foo/bar/bar.plugin.zsh new file mode 100644 index 0000000..b391747 --- /dev/null +++ b/tests/tmp_home/.cache/antidote/foo/bar/bar.plugin.zsh @@ -0,0 +1,2 @@ +echo "sourcing foo/bar..." +plugins=($plugins foo/bar) diff --git a/tests/tmp_home/.cache/antidote/foo/baz/.mockgit/config/remote.origin.url b/tests/tmp_home/.cache/antidote/foo/baz/.mockgit/config/remote.origin.url new file mode 100644 index 0000000..75798f2 --- /dev/null +++ b/tests/tmp_home/.cache/antidote/foo/baz/.mockgit/config/remote.origin.url @@ -0,0 +1 @@ +https://github.com/foo/baz diff --git a/tests/tmp_home/.cache/antidote/foo/baz/baz.plugin.zsh b/tests/tmp_home/.cache/antidote/foo/baz/baz.plugin.zsh new file mode 100644 index 0000000..7de75c6 --- /dev/null +++ b/tests/tmp_home/.cache/antidote/foo/baz/baz.plugin.zsh @@ -0,0 +1,2 @@ +echo "sourcing foo/baz..." +plugins=($plugins foo/baz) diff --git a/tests/tmp_home/.cache/antidote/foo/baz/functions/_baz b/tests/tmp_home/.cache/antidote/foo/baz/functions/_baz new file mode 100644 index 0000000..d61a639 --- /dev/null +++ b/tests/tmp_home/.cache/antidote/foo/baz/functions/_baz @@ -0,0 +1,2 @@ +#!/bin/zsh +echo _baz completion diff --git a/tests/tmp_home/.cache/antidote/foo/baz/functions/baz b/tests/tmp_home/.cache/antidote/foo/baz/functions/baz new file mode 100644 index 0000000..40e9f40 --- /dev/null +++ b/tests/tmp_home/.cache/antidote/foo/baz/functions/baz @@ -0,0 +1,5 @@ +#!/bin/zsh +function baz { + echo baz function +} +baz "$@" diff --git a/tests/tmp_home/.cache/antidote/foo/qux/.mockgit/config/remote.origin.url b/tests/tmp_home/.cache/antidote/foo/qux/.mockgit/config/remote.origin.url new file mode 100644 index 0000000..8d13ef7 --- /dev/null +++ b/tests/tmp_home/.cache/antidote/foo/qux/.mockgit/config/remote.origin.url @@ -0,0 +1 @@ +git@github.com:foo/qux diff --git a/tests/tmp_home/.cache/antidote/foo/qux/qux.plugin.zsh b/tests/tmp_home/.cache/antidote/foo/qux/qux.plugin.zsh new file mode 100644 index 0000000..ef59ec0 --- /dev/null +++ b/tests/tmp_home/.cache/antidote/foo/qux/qux.plugin.zsh @@ -0,0 +1,2 @@ +echo "sourcing foo/qux..." +plugins=($plugins foo/qux) diff --git a/tests/tmp_home/.cache/antidote/getantidote/zsh-defer/.mockgit/config/remote.origin.url b/tests/tmp_home/.cache/antidote/getantidote/zsh-defer/.mockgit/config/remote.origin.url new file mode 100644 index 0000000..83ac51c --- /dev/null +++ b/tests/tmp_home/.cache/antidote/getantidote/zsh-defer/.mockgit/config/remote.origin.url @@ -0,0 +1 @@ +https://github.com/getantidote/zsh-defer diff --git a/tests/tmp_home/.cache/antidote/getantidote/zsh-defer/zsh-defer.plugin.zsh b/tests/tmp_home/.cache/antidote/getantidote/zsh-defer/zsh-defer.plugin.zsh new file mode 100644 index 0000000..20a8508 --- /dev/null +++ b/tests/tmp_home/.cache/antidote/getantidote/zsh-defer/zsh-defer.plugin.zsh @@ -0,0 +1,6 @@ +# fake foo/bar +echo "sourcing getantidote/zsh-defer..." +plugins=($plugins getantidote/zsh-defer) +function zsh-defer { + $@ +} diff --git a/tests/tmp_home/.cache/antidote/ohmy/ohmy/.mockgit/config/remote.origin.url b/tests/tmp_home/.cache/antidote/ohmy/ohmy/.mockgit/config/remote.origin.url new file mode 100644 index 0000000..bdfaa9f --- /dev/null +++ b/tests/tmp_home/.cache/antidote/ohmy/ohmy/.mockgit/config/remote.origin.url @@ -0,0 +1 @@ +https://github.com/ohmy/ohmy diff --git a/tests/tmp_home/.cache/antidote/ohmy/ohmy/custom/themes/pretty.zsh-theme b/tests/tmp_home/.cache/antidote/ohmy/ohmy/custom/themes/pretty.zsh-theme new file mode 100644 index 0000000..96e3a46 --- /dev/null +++ b/tests/tmp_home/.cache/antidote/ohmy/ohmy/custom/themes/pretty.zsh-theme @@ -0,0 +1,2 @@ +echo "sourcing pretty.zsh-theme..." +themes=($themes ohmy:pretty) diff --git a/tests/tmp_home/.cache/antidote/ohmy/ohmy/custom/themes/ugly.zsh-theme b/tests/tmp_home/.cache/antidote/ohmy/ohmy/custom/themes/ugly.zsh-theme new file mode 100644 index 0000000..4ecef6e --- /dev/null +++ b/tests/tmp_home/.cache/antidote/ohmy/ohmy/custom/themes/ugly.zsh-theme @@ -0,0 +1,2 @@ +echo "sourcing ugly.zsh-theme..." +themes=($themes ohmy:ugly) diff --git a/tests/tmp_home/.cache/antidote/ohmy/ohmy/lib/lib1.zsh b/tests/tmp_home/.cache/antidote/ohmy/ohmy/lib/lib1.zsh new file mode 100644 index 0000000..fdbbf9f --- /dev/null +++ b/tests/tmp_home/.cache/antidote/ohmy/ohmy/lib/lib1.zsh @@ -0,0 +1,2 @@ +echo "sourcing ohmy/lib/lib1.zsh..." +libs=($libs ohmy:lib1) diff --git a/tests/tmp_home/.cache/antidote/ohmy/ohmy/lib/lib2.zsh b/tests/tmp_home/.cache/antidote/ohmy/ohmy/lib/lib2.zsh new file mode 100644 index 0000000..790dee9 --- /dev/null +++ b/tests/tmp_home/.cache/antidote/ohmy/ohmy/lib/lib2.zsh @@ -0,0 +1,2 @@ +echo "sourcing ohmy/lib/lib2.zsh..." +libs=($libs ohmy:lib2) diff --git a/tests/tmp_home/.cache/antidote/ohmy/ohmy/lib/lib3.zsh b/tests/tmp_home/.cache/antidote/ohmy/ohmy/lib/lib3.zsh new file mode 100644 index 0000000..698757d --- /dev/null +++ b/tests/tmp_home/.cache/antidote/ohmy/ohmy/lib/lib3.zsh @@ -0,0 +1,2 @@ +echo "sourcing ohmy/lib/lib3.zsh..." +libs=($libs ohmy:lib2) diff --git a/tests/tmp_home/.cache/antidote/ohmy/ohmy/oh-my.sh b/tests/tmp_home/.cache/antidote/ohmy/ohmy/oh-my.sh new file mode 100644 index 0000000..9f4ff77 --- /dev/null +++ b/tests/tmp_home/.cache/antidote/ohmy/ohmy/oh-my.sh @@ -0,0 +1,2 @@ +echo "sourcing oh-my.sh..." +plugins=($plugins ohmy/ohmy) diff --git a/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/docker/_docker b/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/docker/_docker new file mode 100644 index 0000000..8d50524 --- /dev/null +++ b/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/docker/_docker @@ -0,0 +1 @@ +#compdef diff --git a/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/docker/docker.plugin.zsh b/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/docker/docker.plugin.zsh new file mode 100644 index 0000000..6ffd179 --- /dev/null +++ b/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/docker/docker.plugin.zsh @@ -0,0 +1,2 @@ +echo "sourcing docker.plugin.zsh..." +plugins+=(ohmy:docker) diff --git a/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/extract/extract.plugin.zsh b/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/extract/extract.plugin.zsh new file mode 100644 index 0000000..0631391 --- /dev/null +++ b/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/extract/extract.plugin.zsh @@ -0,0 +1,2 @@ +echo "sourcing extract.plugin.zsh..." +plugins+=(ohmy:extract) diff --git a/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/macos/functions/macos_func b/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/macos/functions/macos_func new file mode 100644 index 0000000..2d31f90 --- /dev/null +++ b/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/macos/functions/macos_func @@ -0,0 +1,5 @@ +#!/bin/zsh +function macos_func { + echo macos_func "$@" +} +macos_func "$@" diff --git a/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/macos/macos.plugin.zsh b/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/macos/macos.plugin.zsh new file mode 100644 index 0000000..443aa58 --- /dev/null +++ b/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/macos/macos.plugin.zsh @@ -0,0 +1,2 @@ +echo "sourcing macos.plugin.zsh..." +plugins+=(ohmy:macos) diff --git a/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/magic-enter/magic-enter.plugin.zsh b/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/magic-enter/magic-enter.plugin.zsh new file mode 100644 index 0000000..47d800e --- /dev/null +++ b/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/magic-enter/magic-enter.plugin.zsh @@ -0,0 +1,2 @@ +echo "sourcing magic-enter.plugin.zsh..." +plugins+=(ohmy:magic-enter) diff --git a/tests/tmp_home/.cache/antidote/ohmy/ohmy/themes/pretty.zsh-theme b/tests/tmp_home/.cache/antidote/ohmy/ohmy/themes/pretty.zsh-theme new file mode 100644 index 0000000..96e3a46 --- /dev/null +++ b/tests/tmp_home/.cache/antidote/ohmy/ohmy/themes/pretty.zsh-theme @@ -0,0 +1,2 @@ +echo "sourcing pretty.zsh-theme..." +themes=($themes ohmy:pretty) diff --git a/tests/zdotdir/.zplugins_fake_load b/tests/tmp_home/.zsh/.zplugins_fake_load similarity index 79% rename from tests/zdotdir/.zplugins_fake_load rename to tests/tmp_home/.zsh/.zplugins_fake_load index 3e99158..8ed19d0 100644 --- a/tests/zdotdir/.zplugins_fake_load +++ b/tests/tmp_home/.zsh/.zplugins_fake_load @@ -1,9 +1,9 @@ # repo plugins foo/bar -git@github.com:baz/qux.git # trailing comments +git@github.com:foo/qux.git # trailing comments # kind:clone -romkatv/zsh-defer kind:clone # more trailing comments +getantidote/zsh-defer kind:clone # more trailing comments # kind:zsh foo/bar kind:zsh diff --git a/tests/zdotdir/.zsh_plugins.txt b/tests/tmp_home/.zsh/.zsh_plugins.txt similarity index 69% rename from tests/zdotdir/.zsh_plugins.txt rename to tests/tmp_home/.zsh/.zsh_plugins.txt index 889d346..1ebc6db 100644 --- a/tests/zdotdir/.zsh_plugins.txt +++ b/tests/tmp_home/.zsh/.zsh_plugins.txt @@ -1,14 +1,13 @@ # local plugins ~/foo/bar -$ZDOTDIR/foo/bar -$ZDOTDIR/foo/bar path:baz +$ZSH_CUSTOM path:plugins/myplugin # repo plugins foo/bar -git@github.com:baz/qux.git # trailing comments +git@github.com:foo/qux.git # trailing comments # kind:clone -romkatv/zsh-defer kind:clone # more trailing comments +getantidote/zsh-defer kind:clone # more trailing comments # kind:zsh foo/bar kind:zsh diff --git a/tests/zdotdir/aliases.zsh b/tests/tmp_home/.zsh/aliases.zsh similarity index 100% rename from tests/zdotdir/aliases.zsh rename to tests/tmp_home/.zsh/aliases.zsh diff --git a/tests/zdotdir/custom/lib/lib1.zsh b/tests/tmp_home/.zsh/custom/lib/lib1.zsh similarity index 100% rename from tests/zdotdir/custom/lib/lib1.zsh rename to tests/tmp_home/.zsh/custom/lib/lib1.zsh diff --git a/tests/zdotdir/custom/lib/lib2.zsh b/tests/tmp_home/.zsh/custom/lib/lib2.zsh similarity index 100% rename from tests/zdotdir/custom/lib/lib2.zsh rename to tests/tmp_home/.zsh/custom/lib/lib2.zsh diff --git a/tests/zdotdir/custom/plugins/grizwold/grizwold.plugin.zsh b/tests/tmp_home/.zsh/custom/plugins/grizwold/grizwold.plugin.zsh similarity index 100% rename from tests/zdotdir/custom/plugins/grizwold/grizwold.plugin.zsh rename to tests/tmp_home/.zsh/custom/plugins/grizwold/grizwold.plugin.zsh diff --git a/tests/zdotdir/custom/plugins/myplugin/myplugin.plugin.zsh b/tests/tmp_home/.zsh/custom/plugins/myplugin/myplugin.plugin.zsh similarity index 100% rename from tests/zdotdir/custom/plugins/myplugin/myplugin.plugin.zsh rename to tests/tmp_home/.zsh/custom/plugins/myplugin/myplugin.plugin.zsh diff --git a/tests/zdotdir/custom/plugins/mytheme/mytheme.zsh-theme b/tests/tmp_home/.zsh/custom/plugins/mytheme/mytheme.zsh-theme similarity index 100% rename from tests/zdotdir/custom/plugins/mytheme/mytheme.zsh-theme rename to tests/tmp_home/.zsh/custom/plugins/mytheme/mytheme.zsh-theme diff --git a/tests/zdotdir/functions/myfunc b/tests/tmp_home/.zsh/functions/myfunc similarity index 100% rename from tests/zdotdir/functions/myfunc rename to tests/tmp_home/.zsh/functions/myfunc diff --git a/tests/zdotdir/antidote_home/git-AT-github.aaakk.us.kg-COLON-baz-SLASH-qux/qux.plugin.zsh b/tests/zdotdir/antidote_home/git-AT-github.aaakk.us.kg-COLON-baz-SLASH-qux/qux.plugin.zsh deleted file mode 100644 index aec3336..0000000 --- a/tests/zdotdir/antidote_home/git-AT-github.aaakk.us.kg-COLON-baz-SLASH-qux/qux.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -echo "sourcing baz/qux..." -plugins=($plugins baz/qux) diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-bar-SLASH-baz/baz.plugin.zsh b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-bar-SLASH-baz/baz.plugin.zsh deleted file mode 100644 index b28dd10..0000000 --- a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-bar-SLASH-baz/baz.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -echo "sourcing bar/baz..." -plugins=($plugins bar/baz) diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh deleted file mode 100644 index 841cee6..0000000 --- a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.aaakk.us.kg-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh +++ /dev/null @@ -1,6 +0,0 @@ -# fake foo/bar -echo "sourcing romkatv/zsh-defer..." -plugins=($plugins romkatv/zsh-defer) -function zsh-defer { - $@ -} diff --git a/tools/buildman b/tools/buildman index 719e54a..3c2e0b8 100755 --- a/tools/buildman +++ b/tools/buildman @@ -7,9 +7,13 @@ 0=${(%):-%x} BASEDIR=${0:a:h:h} TMPDIR=$BASEDIR/.tmp/buildman -[[ -d $TMPDIR ]] && rm -rf $TMPDIR +[[ -d $TMPDIR ]] && command rm -rf $TMPDIR mkdir -p $TMPDIR +sedi() { + sed --version &> /dev/null && sed -i -- "$@" || sed -i "" "$@" +} + for manpage in $BASEDIR/man/*.md; do case ${manpage:t:r} in footer|example) continue ;; @@ -22,5 +26,11 @@ for manpage in $BASEDIR/man/*.md; do print "" >> $mdfile cat $BASEDIR/man/footer.md >> $mdfile - pandoc --standalone --to man ${mdfile} -o $BASEDIR/man/man1/${manpage:t:r}.1 + manfile=$BASEDIR/man/man1/${manpage:t:r}.1 + pandoc --standalone --to man ${mdfile} -o $manfile + + # strip pandoc version so that every manpage build doesn't need to + # result in a new commit just b/c pandoc has a minor point release. + pandoc_ver=$(pandoc -v | awk 'NR==1{print $2}') + sedi "s/Pandoc $pandoc_ver/Pandoc/g" $manfile done