From 3c463cbd1dfc3ce3b712a51d323ae345db34737d Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Tue, 16 Jul 2024 16:26:48 -0400 Subject: [PATCH 01/28] Fix #181: Use regular green - Let's just use plain green for updates - no need to bold it --- functions/antidote-update | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/functions/antidote-update b/functions/antidote-update index 4836873..ff775eb 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 @@ -51,7 +49,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 +62,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 From 2ddee051fa9db720e70c86b164bc4510d85bb495 Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Tue, 16 Jul 2024 17:27:17 -0400 Subject: [PATCH 02/28] Build manpages --- man/man1/antidote-bundle.1 | 2 +- man/man1/antidote-help.1 | 2 +- man/man1/antidote-home.1 | 2 +- man/man1/antidote-init.1 | 2 +- man/man1/antidote-install.1 | 2 +- man/man1/antidote-list.1 | 2 +- man/man1/antidote-load.1 | 2 +- man/man1/antidote-path.1 | 2 +- man/man1/antidote-purge.1 | 2 +- man/man1/antidote-update.1 | 2 +- man/man1/antidote.1 | 6 +++++- tools/buildman | 12 +++++++++++- 12 files changed, 26 insertions(+), 12 deletions(-) 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..2b96b77 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,10 @@ 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' .SH SEE ALSO For more information, visit https://getantidote.github.io/ .SH BUGS diff --git a/tools/buildman b/tools/buildman index 719e54a..8f263e3 100755 --- a/tools/buildman +++ b/tools/buildman @@ -10,6 +10,10 @@ TMPDIR=$BASEDIR/.tmp/buildman [[ -d $TMPDIR ]] && 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 From 620ded180b9be1c6fd1aa2b2371baf4b153119df Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Tue, 16 Jul 2024 17:58:10 -0400 Subject: [PATCH 03/28] Fix type-o --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From fd90f64cc31ad6c13b4b1a95f78361481b03e06f Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Wed, 17 Jul 2024 10:31:39 -0400 Subject: [PATCH 04/28] Support zstyle to customize zsh-defer repo --- functions/__antidote_bulk_clone | 9 +++++++-- functions/antidote-script | 7 +++++-- 2 files changed, 12 insertions(+), 4 deletions(-) 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-script b/functions/antidote-script index 410aac6..aa78132 100644 --- a/functions/antidote-script +++ b/functions/antidote-script @@ -107,11 +107,14 @@ # 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 @@ -123,7 +126,7 @@ else script+=("fpath+=( ${bundle_path}/${o_autoload[-1]} )") fi - script+=( "builtin autoload -Uz \$fpath[-1]/*(N.:t)" ) + script+=("builtin autoload -Uz \$fpath[-1]/*(N.:t)") fi # generate load script From aa2c3f65cbe27bb7711b001bc2113410e17f0b1e Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Wed, 17 Jul 2024 10:51:46 -0400 Subject: [PATCH 05/28] Add test for replacing zsh-defer bundle --- tests/test_alt_zsh_defer_bundle.md | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/test_alt_zsh_defer_bundle.md diff --git a/tests/test_alt_zsh_defer_bundle.md b/tests/test_alt_zsh_defer_bundle.md new file mode 100644 index 0000000..4cb2550 --- /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 'getantidote/zsh-defer' +% antidote bundle 'zsh-users/zsh-autosuggestions kind:defer' 2>/dev/null | subenv ANTIDOTE_HOME +if ! (( $+functions[zsh-defer] )); then + fpath+=( $ANTIDOTE_HOME/getantidote/zsh-defer ) + source $ANTIDOTE_HOME/getantidote/zsh-defer/zsh-defer.plugin.zsh +fi +fpath+=( $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions ) +zsh-defer source $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh +% +``` + +## Teardown + +```zsh +% t_teardown +% +``` From 7b9bdd83fb9139b085524f58715d327aee2f9ed6 Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Wed, 17 Jul 2024 12:52:41 -0400 Subject: [PATCH 06/28] Document zstyle customizations --- man/antidote.md | 8 ++++++++ man/man1/antidote.1 | 12 ++++++++++++ 2 files changed, 20 insertions(+) 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.1 b/man/man1/antidote.1 index 2b96b77..c5cc4e2 100644 --- a/man/man1/antidote.1 +++ b/man/man1/antidote.1 @@ -236,6 +236,18 @@ The static file can be Zsh compiled with the following \f[B]zstyle\f[R]: 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 From eba675e27327af69dd7152761f5436e1845c700d Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Wed, 17 Jul 2024 14:34:49 -0400 Subject: [PATCH 07/28] Add new-style test directory --- .gitignore | 1 + .../.cache/antidote/foo/bar/.mockgit/.gitkeep | 0 .../.cache/antidote/foo/bar/bar.plugin.zsh | 2 + .../.cache/antidote/foo/baz/.mockgit/.gitkeep | 0 .../.cache/antidote/foo/baz/baz.plugin.zsh | 2 + .../.cache/antidote/foo/baz/functions/_baz | 2 + .../.cache/antidote/foo/baz/functions/baz | 5 + .../.cache/antidote/foo/qux/.mockgit/.gitkeep | 0 .../.cache/antidote/foo/qux/qux.plugin.zsh | 2 + .../getantidote/zsh-defer/.mockgit/.gitkeep | 0 .../zsh-defer/zsh-defer.plugin.zsh | 6 + .../antidote/ohmy/ohmy/.mockgit/.gitkeep | 0 .../ohmy/ohmy/custom/themes/pretty.zsh-theme | 2 + .../ohmy/ohmy/custom/themes/ugly.zsh-theme | 2 + .../.cache/antidote/ohmy/ohmy/lib/lib1.zsh | 2 + .../.cache/antidote/ohmy/ohmy/lib/lib2.zsh | 2 + .../.cache/antidote/ohmy/ohmy/lib/lib3.zsh | 2 + .../.cache/antidote/ohmy/ohmy/oh-my.sh | 2 + .../antidote/ohmy/ohmy/plugins/docker/_docker | 1 + .../ohmy/plugins/docker/docker.plugin.zsh | 2 + .../ohmy/plugins/extract/extract.plugin.zsh | 2 + .../ohmy/plugins/macos/functions/macos_func | 5 + .../ohmy/ohmy/plugins/macos/macos.plugin.zsh | 2 + .../magic-enter/magic-enter.plugin.zsh | 2 + .../ohmy/ohmy/themes/pretty.zsh-theme | 2 + tests/tmp_home/.zsh/.zsh_plugins.txt | 30 +++ tests/tmp_home/.zsh/custom/lib/lib1.zsh | 2 + tests/tmp_home/.zsh/custom/lib/lib2.zsh | 2 + .../plugins/grizwold/grizwold.plugin.zsh | 187 ++++++++++++++++++ .../plugins/myplugin/myplugin.plugin.zsh | 3 + .../custom/plugins/mytheme/mytheme.zsh-theme | 2 + tests/tmp_home/.zsh/functions/myfunc | 5 + 32 files changed, 279 insertions(+) create mode 100644 tests/tmp_home/.cache/antidote/foo/bar/.mockgit/.gitkeep create mode 100644 tests/tmp_home/.cache/antidote/foo/bar/bar.plugin.zsh create mode 100644 tests/tmp_home/.cache/antidote/foo/baz/.mockgit/.gitkeep create mode 100644 tests/tmp_home/.cache/antidote/foo/baz/baz.plugin.zsh create mode 100644 tests/tmp_home/.cache/antidote/foo/baz/functions/_baz create mode 100644 tests/tmp_home/.cache/antidote/foo/baz/functions/baz create mode 100644 tests/tmp_home/.cache/antidote/foo/qux/.mockgit/.gitkeep create mode 100644 tests/tmp_home/.cache/antidote/foo/qux/qux.plugin.zsh create mode 100644 tests/tmp_home/.cache/antidote/getantidote/zsh-defer/.mockgit/.gitkeep create mode 100644 tests/tmp_home/.cache/antidote/getantidote/zsh-defer/zsh-defer.plugin.zsh create mode 100644 tests/tmp_home/.cache/antidote/ohmy/ohmy/.mockgit/.gitkeep create mode 100644 tests/tmp_home/.cache/antidote/ohmy/ohmy/custom/themes/pretty.zsh-theme create mode 100644 tests/tmp_home/.cache/antidote/ohmy/ohmy/custom/themes/ugly.zsh-theme create mode 100644 tests/tmp_home/.cache/antidote/ohmy/ohmy/lib/lib1.zsh create mode 100644 tests/tmp_home/.cache/antidote/ohmy/ohmy/lib/lib2.zsh create mode 100644 tests/tmp_home/.cache/antidote/ohmy/ohmy/lib/lib3.zsh create mode 100644 tests/tmp_home/.cache/antidote/ohmy/ohmy/oh-my.sh create mode 100644 tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/docker/_docker create mode 100644 tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/docker/docker.plugin.zsh create mode 100644 tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/extract/extract.plugin.zsh create mode 100644 tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/macos/functions/macos_func create mode 100644 tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/macos/macos.plugin.zsh create mode 100644 tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/magic-enter/magic-enter.plugin.zsh create mode 100644 tests/tmp_home/.cache/antidote/ohmy/ohmy/themes/pretty.zsh-theme create mode 100644 tests/tmp_home/.zsh/.zsh_plugins.txt create mode 100644 tests/tmp_home/.zsh/custom/lib/lib1.zsh create mode 100644 tests/tmp_home/.zsh/custom/lib/lib2.zsh create mode 100644 tests/tmp_home/.zsh/custom/plugins/grizwold/grizwold.plugin.zsh create mode 100644 tests/tmp_home/.zsh/custom/plugins/myplugin/myplugin.plugin.zsh create mode 100644 tests/tmp_home/.zsh/custom/plugins/mytheme/mytheme.zsh-theme create mode 100644 tests/tmp_home/.zsh/functions/myfunc 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/tests/tmp_home/.cache/antidote/foo/bar/.mockgit/.gitkeep b/tests/tmp_home/.cache/antidote/foo/bar/.mockgit/.gitkeep new file mode 100644 index 0000000..e69de29 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/.gitkeep b/tests/tmp_home/.cache/antidote/foo/baz/.mockgit/.gitkeep new file mode 100644 index 0000000..e69de29 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/.gitkeep b/tests/tmp_home/.cache/antidote/foo/qux/.mockgit/.gitkeep new file mode 100644 index 0000000..e69de29 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/.gitkeep b/tests/tmp_home/.cache/antidote/getantidote/zsh-defer/.mockgit/.gitkeep new file mode 100644 index 0000000..e69de29 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..841cee6 --- /dev/null +++ b/tests/tmp_home/.cache/antidote/getantidote/zsh-defer/zsh-defer.plugin.zsh @@ -0,0 +1,6 @@ +# fake foo/bar +echo "sourcing romkatv/zsh-defer..." +plugins=($plugins romkatv/zsh-defer) +function zsh-defer { + $@ +} diff --git a/tests/tmp_home/.cache/antidote/ohmy/ohmy/.mockgit/.gitkeep b/tests/tmp_home/.cache/antidote/ohmy/ohmy/.mockgit/.gitkeep new file mode 100644 index 0000000..e69de29 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/tmp_home/.zsh/.zsh_plugins.txt b/tests/tmp_home/.zsh/.zsh_plugins.txt new file mode 100644 index 0000000..f62dfab --- /dev/null +++ b/tests/tmp_home/.zsh/.zsh_plugins.txt @@ -0,0 +1,30 @@ +# local plugins +~/foo/bar +$ZDOTDIR/foo/bar +$ZDOTDIR/foo/bar path:baz + +# repo plugins +foo/bar +git@github.com:baz/qux.git # trailing comments + +# kind:clone +getantidote/zsh-defer kind:clone # more trailing comments + +# kind:zsh +foo/bar kind:zsh + +# kind:fpath +foo/bar kind:fpath + +# kind:path +foo/bar kind:path + +# subpath plugins +ohmy/ohmy path:lib +ohmy/ohmy path:plugins/extract + +# deferred +ohmy/ohmy path:plugins/magic-enter kind:defer + +# theme +ohmy/ohmy path:custom/themes/pretty.zsh-theme diff --git a/tests/tmp_home/.zsh/custom/lib/lib1.zsh b/tests/tmp_home/.zsh/custom/lib/lib1.zsh new file mode 100644 index 0000000..1cf38dd --- /dev/null +++ b/tests/tmp_home/.zsh/custom/lib/lib1.zsh @@ -0,0 +1,2 @@ +echo "sourcing custom lib1.zsh..." +libs=($libs custom:lib1) diff --git a/tests/tmp_home/.zsh/custom/lib/lib2.zsh b/tests/tmp_home/.zsh/custom/lib/lib2.zsh new file mode 100644 index 0000000..c858eed --- /dev/null +++ b/tests/tmp_home/.zsh/custom/lib/lib2.zsh @@ -0,0 +1,2 @@ +echo "sourcing custom lib2.zsh..." +libs=($libs custom:lib2) diff --git a/tests/tmp_home/.zsh/custom/plugins/grizwold/grizwold.plugin.zsh b/tests/tmp_home/.zsh/custom/plugins/grizwold/grizwold.plugin.zsh new file mode 100644 index 0000000..6f076cb --- /dev/null +++ b/tests/tmp_home/.zsh/custom/plugins/grizwold/grizwold.plugin.zsh @@ -0,0 +1,187 @@ +() { + setopt interactivecomments + typeset -ga grizwold_zopts=( + noaliases + aliasfuncdef + allexport + noalwayslastprompt + alwaystoend + appendcreate + noappendhistory + autocd + autocontinue + noautolist + noautomenu + autonamedirs + noautoparamkeys + noautoparamslash + autopushd + noautoremoveslash + autoresume + nobadpattern + nobanghist + nobareglobqual + bashautolist + bashrematch + nobeep + nobgnice + braceccl + bsdecho + nocaseglob + nocasematch + cbases + cdablevars + cdsilent + chasedots + chaselinks + nocheckjobs + nocheckrunningjobs + # noclobber + combiningchars + completealiases + completeinword + continueonerror + correct + correctall + cprecedences + cshjunkiehistory + cshjunkieloops + cshjunkiequotes + cshnullcmd + cshnullglob + nodebugbeforecmd + dvorak + emacs + noequals + # errexit + # errreturn + noevallineno + # noexec + extendedglob + extendedhistory + noflowcontrol + # forcefloat + nofunctionargzero + noglob + noglobalexport + # noglobalrcs + globassign + globcomplete + globdots + globstarshort + globsubst + nohashcmds + nohashdirs + hashexecutablesonly + nohashlistall + histallowclobber + nohistbeep + histexpiredupsfirst + histfcntllock + histfindnodups + histignorealldups + histignoredups + histignorespace + histlexwords + histnofunctions + histnostore + histreduceblanks + nohistsavebycopy + histsavenodups + histsubstpattern + histverify + nohup + ignorebraces + ignoreclosebraces + ignoreeof + incappendhistory + incappendhistorytime + # interactive + interactivecomments + # ksharrays + kshautoload + kshglob + # kshoptionprint + kshtypeset + kshzerosubscript + nolistambiguous + nolistbeep + listpacked + listrowsfirst + nolisttypes + localloops + # localoptions + localpatterns + localtraps + # login + longlistjobs + magicequalsubst + mailwarning + markdirs + menucomplete + # monitor + nomultibyte + nomultifuncdef + nomultios + nonomatch + nonotify + nullglob + numericglobsort + octalzeroes + overstrike + pathdirs + pathscript + pipefail + posixaliases + posixargzero + posixbuiltins + posixcd + posixidentifiers + posixjobs + # posixstrings + posixtraps + printeightbit + printexitvalue + # privileged + promptbang + nopromptcr + # nopromptpercent + nopromptsp + promptsubst + pushdignoredups + pushdminus + pushdsilent + pushdtohome + rcexpandparam + rcquotes + # norcs + recexact + rematchpcre + # restricted + rmstarsilent + rmstarwait + sharehistory + shfileexpansion + shglob + # shinstdin + shnullcmd + shoptionletters + noshortloops + shwordsplit + # singlecommand + singlelinezle + # sourcetrace + sunkeyboardhack + transientrprompt + trapsasync + typesetsilent + nounset + # verbose + # vi + warncreateglobal + warnnestedvar + # xtrace + # zle + ) + setopt $grizwold_zopts +} diff --git a/tests/tmp_home/.zsh/custom/plugins/myplugin/myplugin.plugin.zsh b/tests/tmp_home/.zsh/custom/plugins/myplugin/myplugin.plugin.zsh new file mode 100644 index 0000000..871e1c5 --- /dev/null +++ b/tests/tmp_home/.zsh/custom/plugins/myplugin/myplugin.plugin.zsh @@ -0,0 +1,3 @@ +# fake foo/bar +echo "sourcing myplugin..." +plugins+=(custom:myplugin) diff --git a/tests/tmp_home/.zsh/custom/plugins/mytheme/mytheme.zsh-theme b/tests/tmp_home/.zsh/custom/plugins/mytheme/mytheme.zsh-theme new file mode 100644 index 0000000..51d3a8b --- /dev/null +++ b/tests/tmp_home/.zsh/custom/plugins/mytheme/mytheme.zsh-theme @@ -0,0 +1,2 @@ +echo "sourcing mytheme..." +plugins+=(custom:mytheme) diff --git a/tests/tmp_home/.zsh/functions/myfunc b/tests/tmp_home/.zsh/functions/myfunc new file mode 100644 index 0000000..bb9ebd1 --- /dev/null +++ b/tests/tmp_home/.zsh/functions/myfunc @@ -0,0 +1,5 @@ +#!/bin/zsh +function myfunc { + echo myfunc "$@" +} +myfunc "$@" From 28c1693b12da54a01090ad95249303266faa2837 Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Wed, 17 Jul 2024 14:54:12 -0400 Subject: [PATCH 08/28] Rename antidote core tests --- tests/{test_antidote.md => test_antidote_core.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/{test_antidote.md => test_antidote_core.md} (100%) diff --git a/tests/test_antidote.md b/tests/test_antidote_core.md similarity index 100% rename from tests/test_antidote.md rename to tests/test_antidote_core.md From cb22fa6b31e88fbefe140f7c50e76066f95f8db7 Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Wed, 17 Jul 2024 17:28:00 -0400 Subject: [PATCH 09/28] Change altered defer test --- tests/test_alt_zsh_defer_bundle.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_alt_zsh_defer_bundle.md b/tests/test_alt_zsh_defer_bundle.md index 4cb2550..5a90701 100644 --- a/tests/test_alt_zsh_defer_bundle.md +++ b/tests/test_alt_zsh_defer_bundle.md @@ -16,11 +16,11 @@ If the user forks zsh-defer, support setting a zstyle for an alternative repo lo ```zsh % zstyle ':antidote:bundle' use-friendly-names on -% zstyle ':antidote:defer' bundle 'getantidote/zsh-defer' +% zstyle ':antidote:defer' bundle 'custom/zsh-defer' % antidote bundle 'zsh-users/zsh-autosuggestions kind:defer' 2>/dev/null | subenv ANTIDOTE_HOME if ! (( $+functions[zsh-defer] )); then - fpath+=( $ANTIDOTE_HOME/getantidote/zsh-defer ) - source $ANTIDOTE_HOME/getantidote/zsh-defer/zsh-defer.plugin.zsh + fpath+=( $ANTIDOTE_HOME/custom/zsh-defer ) + source $ANTIDOTE_HOME/custom/zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions ) zsh-defer source $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh From 3b40b1af20a5cbe457c4f6436f120953da201115 Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Wed, 17 Jul 2024 17:28:31 -0400 Subject: [PATCH 10/28] Remove :use tests for now --- tests/test_cmd_script_use.md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 tests/test_cmd_script_use.md 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 -% -``` From 75fd2453cbe21492ecfed72e4b0d5b248dbb93a6 Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Wed, 17 Jul 2024 17:29:44 -0400 Subject: [PATCH 11/28] Make git mock for remote.origin.url better --- tests/functions/mockgit | 18 +++++++++++------- .../.cache/antidote/foo/bar/.mockgit/.gitkeep | 0 .../foo/bar/.mockgit/config/remote.origin.url | 1 + .../.cache/antidote/foo/baz/.mockgit/.gitkeep | 0 .../foo/baz/.mockgit/config/remote.origin.url | 1 + .../.cache/antidote/foo/qux/.mockgit/.gitkeep | 0 .../foo/qux/.mockgit/config/remote.origin.url | 1 + .../getantidote/zsh-defer/.mockgit/.gitkeep | 0 .../.mockgit/config/remote.origin.url | 1 + .../antidote/ohmy/ohmy/.mockgit/.gitkeep | 0 .../ohmy/.mockgit/config/remote.origin.url | 1 + 11 files changed, 16 insertions(+), 7 deletions(-) delete mode 100644 tests/tmp_home/.cache/antidote/foo/bar/.mockgit/.gitkeep create mode 100644 tests/tmp_home/.cache/antidote/foo/bar/.mockgit/config/remote.origin.url delete mode 100644 tests/tmp_home/.cache/antidote/foo/baz/.mockgit/.gitkeep create mode 100644 tests/tmp_home/.cache/antidote/foo/baz/.mockgit/config/remote.origin.url delete mode 100644 tests/tmp_home/.cache/antidote/foo/qux/.mockgit/.gitkeep create mode 100644 tests/tmp_home/.cache/antidote/foo/qux/.mockgit/config/remote.origin.url delete mode 100644 tests/tmp_home/.cache/antidote/getantidote/zsh-defer/.mockgit/.gitkeep create mode 100644 tests/tmp_home/.cache/antidote/getantidote/zsh-defer/.mockgit/config/remote.origin.url delete mode 100644 tests/tmp_home/.cache/antidote/ohmy/ohmy/.mockgit/.gitkeep create mode 100644 tests/tmp_home/.cache/antidote/ohmy/ohmy/.mockgit/config/remote.origin.url 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/tmp_home/.cache/antidote/foo/bar/.mockgit/.gitkeep b/tests/tmp_home/.cache/antidote/foo/bar/.mockgit/.gitkeep deleted file mode 100644 index e69de29..0000000 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/baz/.mockgit/.gitkeep b/tests/tmp_home/.cache/antidote/foo/baz/.mockgit/.gitkeep deleted file mode 100644 index e69de29..0000000 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..fee100c --- /dev/null +++ b/tests/tmp_home/.cache/antidote/foo/baz/.mockgit/config/remote.origin.url @@ -0,0 +1 @@ +git@github.com:foo/baz diff --git a/tests/tmp_home/.cache/antidote/foo/qux/.mockgit/.gitkeep b/tests/tmp_home/.cache/antidote/foo/qux/.mockgit/.gitkeep deleted file mode 100644 index e69de29..0000000 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..e4bcdb1 --- /dev/null +++ b/tests/tmp_home/.cache/antidote/foo/qux/.mockgit/config/remote.origin.url @@ -0,0 +1 @@ +https://github.com/foo/qux diff --git a/tests/tmp_home/.cache/antidote/getantidote/zsh-defer/.mockgit/.gitkeep b/tests/tmp_home/.cache/antidote/getantidote/zsh-defer/.mockgit/.gitkeep deleted file mode 100644 index e69de29..0000000 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/ohmy/ohmy/.mockgit/.gitkeep b/tests/tmp_home/.cache/antidote/ohmy/ohmy/.mockgit/.gitkeep deleted file mode 100644 index e69de29..0000000 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 From bf98032ccd9949345bc41d0a77c0d8dbf17e2502 Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Wed, 17 Jul 2024 17:30:09 -0400 Subject: [PATCH 12/28] Add file to bumpversion --- .bumpversion.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 25881f1..86d95b0 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -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] From eddf494bb8f0bb84c41a7d8ae5a35c28a083da49 Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Wed, 17 Jul 2024 18:57:29 -0400 Subject: [PATCH 13/28] Add legacy antibody test directories --- .../git-AT-github.com-COLON-foo-SLASH-baz/.mockgit/.gitkeep | 0 .../git-AT-github.com-COLON-foo-SLASH-baz/baz.plugin.zsh | 2 ++ .../git-AT-github.com-COLON-foo-SLASH-baz/functions/_baz | 2 ++ .../git-AT-github.com-COLON-foo-SLASH-baz/functions/baz | 5 +++++ .../.mockgit/.gitkeep | 0 .../bar.plugin.zsh | 2 ++ .../.mockgit/.gitkeep | 0 .../qux.plugin.zsh | 2 ++ .../.mockgit/.gitkeep | 0 .../zsh-defer.plugin.zsh | 6 ++++++ .../.mockgit/.gitkeep | 0 .../custom/themes/pretty.zsh-theme | 2 ++ .../custom/themes/ugly.zsh-theme | 2 ++ .../lib/lib1.zsh | 2 ++ .../lib/lib2.zsh | 2 ++ .../lib/lib3.zsh | 2 ++ .../oh-my.sh | 2 ++ .../plugins/docker/_docker | 1 + .../plugins/docker/docker.plugin.zsh | 2 ++ .../plugins/extract/extract.plugin.zsh | 2 ++ .../plugins/macos/functions/macos_func | 5 +++++ .../plugins/macos/macos.plugin.zsh | 2 ++ .../plugins/magic-enter/magic-enter.plugin.zsh | 2 ++ .../themes/pretty.zsh-theme | 2 ++ tests/tmp_home/.zsh/.zsh_plugins.txt | 5 ++--- 25 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/.mockgit/.gitkeep create mode 100644 tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/baz.plugin.zsh create mode 100644 tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/functions/_baz create mode 100644 tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/functions/baz create mode 100644 tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/.mockgit/.gitkeep create mode 100644 tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/bar.plugin.zsh create mode 100644 tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-qux/.mockgit/.gitkeep create mode 100644 tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-qux/qux.plugin.zsh create mode 100644 tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer/.mockgit/.gitkeep create mode 100644 tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer/zsh-defer.plugin.zsh create mode 100644 tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/.mockgit/.gitkeep create mode 100644 tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/custom/themes/pretty.zsh-theme create mode 100644 tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/custom/themes/ugly.zsh-theme create mode 100644 tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib1.zsh create mode 100644 tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib2.zsh create mode 100644 tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib3.zsh create mode 100644 tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/oh-my.sh create mode 100644 tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker/_docker create mode 100644 tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker/docker.plugin.zsh create mode 100644 tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/extract/extract.plugin.zsh create mode 100644 tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos/functions/macos_func create mode 100644 tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos/macos.plugin.zsh create mode 100644 tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter/magic-enter.plugin.zsh create mode 100644 tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/themes/pretty.zsh-theme diff --git a/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/.mockgit/.gitkeep b/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/.mockgit/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/baz.plugin.zsh b/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/baz.plugin.zsh new file mode 100644 index 0000000..7de75c6 --- /dev/null +++ b/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/baz.plugin.zsh @@ -0,0 +1,2 @@ +echo "sourcing foo/baz..." +plugins=($plugins foo/baz) diff --git a/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/functions/_baz b/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/functions/_baz new file mode 100644 index 0000000..d61a639 --- /dev/null +++ b/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/functions/_baz @@ -0,0 +1,2 @@ +#!/bin/zsh +echo _baz completion diff --git a/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/functions/baz b/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/functions/baz new file mode 100644 index 0000000..40e9f40 --- /dev/null +++ b/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/functions/baz @@ -0,0 +1,5 @@ +#!/bin/zsh +function baz { + echo baz function +} +baz "$@" diff --git a/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/.mockgit/.gitkeep b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/.mockgit/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/bar.plugin.zsh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/bar.plugin.zsh new file mode 100644 index 0000000..b391747 --- /dev/null +++ b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/bar.plugin.zsh @@ -0,0 +1,2 @@ +echo "sourcing foo/bar..." +plugins=($plugins foo/bar) diff --git a/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-qux/.mockgit/.gitkeep b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-qux/.mockgit/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-qux/qux.plugin.zsh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-qux/qux.plugin.zsh new file mode 100644 index 0000000..ef59ec0 --- /dev/null +++ b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-qux/qux.plugin.zsh @@ -0,0 +1,2 @@ +echo "sourcing foo/qux..." +plugins=($plugins foo/qux) diff --git a/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer/.mockgit/.gitkeep b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer/.mockgit/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer/zsh-defer.plugin.zsh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-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.com-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/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/.mockgit/.gitkeep b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/.mockgit/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/custom/themes/pretty.zsh-theme b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/custom/themes/pretty.zsh-theme new file mode 100644 index 0000000..96e3a46 --- /dev/null +++ b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-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/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/custom/themes/ugly.zsh-theme b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/custom/themes/ugly.zsh-theme new file mode 100644 index 0000000..4ecef6e --- /dev/null +++ b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-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/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib1.zsh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib1.zsh new file mode 100644 index 0000000..fdbbf9f --- /dev/null +++ b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-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/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib2.zsh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib2.zsh new file mode 100644 index 0000000..790dee9 --- /dev/null +++ b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-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/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib3.zsh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib3.zsh new file mode 100644 index 0000000..698757d --- /dev/null +++ b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-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/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/oh-my.sh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/oh-my.sh new file mode 100644 index 0000000..9f4ff77 --- /dev/null +++ b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/oh-my.sh @@ -0,0 +1,2 @@ +echo "sourcing oh-my.sh..." +plugins=($plugins ohmy/ohmy) diff --git a/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker/_docker b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker/_docker new file mode 100644 index 0000000..8d50524 --- /dev/null +++ b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker/_docker @@ -0,0 +1 @@ +#compdef diff --git a/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker/docker.plugin.zsh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker/docker.plugin.zsh new file mode 100644 index 0000000..6ffd179 --- /dev/null +++ b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-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/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/extract/extract.plugin.zsh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/extract/extract.plugin.zsh new file mode 100644 index 0000000..0631391 --- /dev/null +++ b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-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/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos/functions/macos_func b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos/functions/macos_func new file mode 100644 index 0000000..2d31f90 --- /dev/null +++ b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-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/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos/macos.plugin.zsh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos/macos.plugin.zsh new file mode 100644 index 0000000..443aa58 --- /dev/null +++ b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-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/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter/magic-enter.plugin.zsh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter/magic-enter.plugin.zsh new file mode 100644 index 0000000..47d800e --- /dev/null +++ b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-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/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/themes/pretty.zsh-theme b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/themes/pretty.zsh-theme new file mode 100644 index 0000000..96e3a46 --- /dev/null +++ b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/themes/pretty.zsh-theme @@ -0,0 +1,2 @@ +echo "sourcing pretty.zsh-theme..." +themes=($themes ohmy:pretty) diff --git a/tests/tmp_home/.zsh/.zsh_plugins.txt b/tests/tmp_home/.zsh/.zsh_plugins.txt index f62dfab..79df569 100644 --- a/tests/tmp_home/.zsh/.zsh_plugins.txt +++ b/tests/tmp_home/.zsh/.zsh_plugins.txt @@ -1,11 +1,10 @@ # 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/baz.git # trailing comments # kind:clone getantidote/zsh-defer kind:clone # more trailing comments From 672e207f461645c466f35f287f6645652f0e8cbf Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Wed, 17 Jul 2024 18:58:01 -0400 Subject: [PATCH 14/28] Remove unused test functions --- tests/functions/filter-comments | 2 -- tests/functions/sed-i | 4 ---- 2 files changed, 6 deletions(-) delete mode 100644 tests/functions/filter-comments delete mode 100644 tests/functions/sed-i 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/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 "" "$@" -#} From dd19bb196e6ab151cfd829a42023488c1f6aa68e Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Wed, 17 Jul 2024 20:19:45 -0400 Subject: [PATCH 15/28] Fix test data --- tests/testdata/.zsh_plugins_purged.txt | 7 +++---- .../.mockgit/.gitkeep | 0 .../qux.plugin.zsh | 0 .../.mockgit/.gitkeep | 0 .../baz.plugin.zsh | 0 .../functions/_baz | 0 .../functions/baz | 0 .../antidote/foo/baz/.mockgit/config/remote.origin.url | 2 +- .../antidote/foo/qux/.mockgit/config/remote.origin.url | 2 +- tests/tmp_home/.zsh/.zsh_plugins.txt | 2 +- 10 files changed, 6 insertions(+), 7 deletions(-) rename tests/tmp_home/.cache/antibody/{git-AT-github.com-COLON-foo-SLASH-baz => git-AT-github.com-COLON-foo-SLASH-qux}/.mockgit/.gitkeep (100%) rename tests/tmp_home/.cache/antibody/{https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-qux => git-AT-github.com-COLON-foo-SLASH-qux}/qux.plugin.zsh (100%) rename tests/tmp_home/.cache/antibody/{https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-qux => https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz}/.mockgit/.gitkeep (100%) rename tests/tmp_home/.cache/antibody/{git-AT-github.com-COLON-foo-SLASH-baz => https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz}/baz.plugin.zsh (100%) rename tests/tmp_home/.cache/antibody/{git-AT-github.com-COLON-foo-SLASH-baz => https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz}/functions/_baz (100%) rename tests/tmp_home/.cache/antibody/{git-AT-github.com-COLON-foo-SLASH-baz => https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz}/functions/baz (100%) diff --git a/tests/testdata/.zsh_plugins_purged.txt b/tests/testdata/.zsh_plugins_purged.txt index 298f59d..d7eb0fd 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/quz.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/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/.mockgit/.gitkeep b/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-qux/.mockgit/.gitkeep similarity index 100% rename from tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/.mockgit/.gitkeep rename to tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-qux/.mockgit/.gitkeep diff --git a/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-qux/qux.plugin.zsh b/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-qux/qux.plugin.zsh similarity index 100% rename from tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-qux/qux.plugin.zsh rename to tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-qux/qux.plugin.zsh diff --git a/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-qux/.mockgit/.gitkeep b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz/.mockgit/.gitkeep similarity index 100% rename from tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-qux/.mockgit/.gitkeep rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz/.mockgit/.gitkeep diff --git a/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/baz.plugin.zsh b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz/baz.plugin.zsh similarity index 100% rename from tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/baz.plugin.zsh rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz/baz.plugin.zsh diff --git a/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/functions/_baz b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz/functions/_baz similarity index 100% rename from tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/functions/_baz rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz/functions/_baz diff --git a/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/functions/baz b/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz/functions/baz similarity index 100% rename from tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-baz/functions/baz rename to tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz/functions/baz 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 index fee100c..75798f2 100644 --- 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 @@ -1 +1 @@ -git@github.com:foo/baz +https://github.com/foo/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 index e4bcdb1..8d13ef7 100644 --- 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 @@ -1 +1 @@ -https://github.com/foo/qux +git@github.com:foo/qux diff --git a/tests/tmp_home/.zsh/.zsh_plugins.txt b/tests/tmp_home/.zsh/.zsh_plugins.txt index 79df569..4d23dba 100644 --- a/tests/tmp_home/.zsh/.zsh_plugins.txt +++ b/tests/tmp_home/.zsh/.zsh_plugins.txt @@ -4,7 +4,7 @@ $ZSH_CUSTOM path:plugins/myplugin # repo plugins foo/bar -git@github.com:foo/baz.git # trailing comments +git@github.com:foo/quz.git # trailing comments # kind:clone getantidote/zsh-defer kind:clone # more trailing comments From ea73a03031693598ab80a71578533c68808dfd2d Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Thu, 18 Jul 2024 12:44:09 -0400 Subject: [PATCH 16/28] Remove legacy test files --- tests/zdotdir/.zplugins_fake_load | 29 --- tests/zdotdir/.zsh_plugins.txt | 30 --- tests/zdotdir/aliases.zsh | 1 - .../.mockgit/.gitkeep | 0 .../qux.plugin.zsh | 2 - .../.mockgit/.gitkeep | 0 .../baz.plugin.zsh | 2 - .../functions/_baz | 2 - .../functions/baz | 5 - .../.mockgit/.gitkeep | 0 .../bar.plugin.zsh | 2 - .../.mockgit/.gitkeep | 0 .../custom/themes/pretty.zsh-theme | 2 - .../custom/themes/ugly.zsh-theme | 2 - .../lib/lib1.zsh | 2 - .../lib/lib2.zsh | 2 - .../lib/lib3.zsh | 2 - .../oh-my.sh | 2 - .../plugins/docker/_docker | 1 - .../plugins/docker/docker.plugin.zsh | 2 - .../plugins/extract/extract.plugin.zsh | 2 - .../plugins/macos/functions/macos_func | 5 - .../plugins/macos/macos.plugin.zsh | 2 - .../magic-enter/magic-enter.plugin.zsh | 2 - .../themes/pretty.zsh-theme | 2 - .../.mockgit/.gitkeep | 0 .../zsh-defer.plugin.zsh | 6 - tests/zdotdir/custom/lib/lib1.zsh | 2 - tests/zdotdir/custom/lib/lib2.zsh | 2 - .../plugins/grizwold/grizwold.plugin.zsh | 187 ------------------ .../plugins/myplugin/myplugin.plugin.zsh | 3 - .../custom/plugins/mytheme/mytheme.zsh-theme | 2 - tests/zdotdir/functions/myfunc | 5 - 33 files changed, 308 deletions(-) delete mode 100644 tests/zdotdir/.zplugins_fake_load delete mode 100644 tests/zdotdir/.zsh_plugins.txt delete mode 100644 tests/zdotdir/aliases.zsh delete mode 100644 tests/zdotdir/antidote_home/git-AT-github.com-COLON-baz-SLASH-qux/.mockgit/.gitkeep delete mode 100644 tests/zdotdir/antidote_home/git-AT-github.com-COLON-baz-SLASH-qux/qux.plugin.zsh delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-bar-SLASH-baz/.mockgit/.gitkeep delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-bar-SLASH-baz/baz.plugin.zsh delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-bar-SLASH-baz/functions/_baz delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-bar-SLASH-baz/functions/baz delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/.mockgit/.gitkeep delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/bar.plugin.zsh delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/.mockgit/.gitkeep delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/custom/themes/pretty.zsh-theme delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/custom/themes/ugly.zsh-theme delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib1.zsh delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib2.zsh delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib3.zsh delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/oh-my.sh delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker/_docker delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker/docker.plugin.zsh delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/extract/extract.plugin.zsh delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos/functions/macos_func delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos/macos.plugin.zsh delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter/magic-enter.plugin.zsh delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/themes/pretty.zsh-theme delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-zsh-defer/.mockgit/.gitkeep delete mode 100644 tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh delete mode 100644 tests/zdotdir/custom/lib/lib1.zsh delete mode 100644 tests/zdotdir/custom/lib/lib2.zsh delete mode 100644 tests/zdotdir/custom/plugins/grizwold/grizwold.plugin.zsh delete mode 100644 tests/zdotdir/custom/plugins/myplugin/myplugin.plugin.zsh delete mode 100644 tests/zdotdir/custom/plugins/mytheme/mytheme.zsh-theme delete mode 100644 tests/zdotdir/functions/myfunc diff --git a/tests/zdotdir/.zplugins_fake_load b/tests/zdotdir/.zplugins_fake_load deleted file mode 100644 index 3e99158..0000000 --- a/tests/zdotdir/.zplugins_fake_load +++ /dev/null @@ -1,29 +0,0 @@ -# repo plugins -foo/bar -git@github.com:baz/qux.git # trailing comments - -# kind:clone -romkatv/zsh-defer kind:clone # more trailing comments - -# kind:zsh -foo/bar kind:zsh - -# kind:fpath -foo/bar kind:fpath - -# kind:path -foo/bar kind:path - -# subpath plugins -ohmy/ohmy path:lib -ohmy/ohmy path:plugins/extract - -# fpath-rule -ohmy/ohmy path:plugins/docker fpath-rule:prepend -ohmy/ohmy path:plugins/docker fpath-rule:append - -# deferred -ohmy/ohmy path:plugins/magic-enter kind:defer - -# theme -ohmy/ohmy path:custom/themes/pretty.zsh-theme diff --git a/tests/zdotdir/.zsh_plugins.txt b/tests/zdotdir/.zsh_plugins.txt deleted file mode 100644 index 889d346..0000000 --- a/tests/zdotdir/.zsh_plugins.txt +++ /dev/null @@ -1,30 +0,0 @@ -# local plugins -~/foo/bar -$ZDOTDIR/foo/bar -$ZDOTDIR/foo/bar path:baz - -# repo plugins -foo/bar -git@github.com:baz/qux.git # trailing comments - -# kind:clone -romkatv/zsh-defer kind:clone # more trailing comments - -# kind:zsh -foo/bar kind:zsh - -# kind:fpath -foo/bar kind:fpath - -# kind:path -foo/bar kind:path - -# subpath plugins -ohmy/ohmy path:lib -ohmy/ohmy path:plugins/extract - -# deferred -ohmy/ohmy path:plugins/magic-enter kind:defer - -# theme -ohmy/ohmy path:custom/themes/pretty.zsh-theme diff --git a/tests/zdotdir/aliases.zsh b/tests/zdotdir/aliases.zsh deleted file mode 100644 index df95e4a..0000000 --- a/tests/zdotdir/aliases.zsh +++ /dev/null @@ -1 +0,0 @@ -echo "sourcing aliases.zsh..." diff --git a/tests/zdotdir/antidote_home/git-AT-github.com-COLON-baz-SLASH-qux/.mockgit/.gitkeep b/tests/zdotdir/antidote_home/git-AT-github.com-COLON-baz-SLASH-qux/.mockgit/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/zdotdir/antidote_home/git-AT-github.com-COLON-baz-SLASH-qux/qux.plugin.zsh b/tests/zdotdir/antidote_home/git-AT-github.com-COLON-baz-SLASH-qux/qux.plugin.zsh deleted file mode 100644 index aec3336..0000000 --- a/tests/zdotdir/antidote_home/git-AT-github.com-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.com-SLASH-bar-SLASH-baz/.mockgit/.gitkeep b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-bar-SLASH-baz/.mockgit/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-bar-SLASH-baz/baz.plugin.zsh b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-bar-SLASH-baz/baz.plugin.zsh deleted file mode 100644 index b28dd10..0000000 --- a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-bar-SLASH-baz/functions/_baz b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-bar-SLASH-baz/functions/_baz deleted file mode 100644 index d61a639..0000000 --- a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-bar-SLASH-baz/functions/_baz +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/zsh -echo _baz completion diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-bar-SLASH-baz/functions/baz b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-bar-SLASH-baz/functions/baz deleted file mode 100644 index 40e9f40..0000000 --- a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-bar-SLASH-baz/functions/baz +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/zsh -function baz { - echo baz function -} -baz "$@" diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/.mockgit/.gitkeep b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/.mockgit/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/bar.plugin.zsh b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/bar.plugin.zsh deleted file mode 100644 index b391747..0000000 --- a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/bar.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -echo "sourcing foo/bar..." -plugins=($plugins foo/bar) diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/.mockgit/.gitkeep b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/.mockgit/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/custom/themes/pretty.zsh-theme b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/custom/themes/pretty.zsh-theme deleted file mode 100644 index 96e3a46..0000000 --- a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/custom/themes/pretty.zsh-theme +++ /dev/null @@ -1,2 +0,0 @@ -echo "sourcing pretty.zsh-theme..." -themes=($themes ohmy:pretty) diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/custom/themes/ugly.zsh-theme b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/custom/themes/ugly.zsh-theme deleted file mode 100644 index 4ecef6e..0000000 --- a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/custom/themes/ugly.zsh-theme +++ /dev/null @@ -1,2 +0,0 @@ -echo "sourcing ugly.zsh-theme..." -themes=($themes ohmy:ugly) diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib1.zsh b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib1.zsh deleted file mode 100644 index fdbbf9f..0000000 --- a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib1.zsh +++ /dev/null @@ -1,2 +0,0 @@ -echo "sourcing ohmy/lib/lib1.zsh..." -libs=($libs ohmy:lib1) diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib2.zsh b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib2.zsh deleted file mode 100644 index 790dee9..0000000 --- a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib2.zsh +++ /dev/null @@ -1,2 +0,0 @@ -echo "sourcing ohmy/lib/lib2.zsh..." -libs=($libs ohmy:lib2) diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib3.zsh b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib3.zsh deleted file mode 100644 index 698757d..0000000 --- a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib3.zsh +++ /dev/null @@ -1,2 +0,0 @@ -echo "sourcing ohmy/lib/lib3.zsh..." -libs=($libs ohmy:lib2) diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/oh-my.sh b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/oh-my.sh deleted file mode 100644 index 9f4ff77..0000000 --- a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/oh-my.sh +++ /dev/null @@ -1,2 +0,0 @@ -echo "sourcing oh-my.sh..." -plugins=($plugins ohmy/ohmy) diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker/_docker b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker/_docker deleted file mode 100644 index 8d50524..0000000 --- a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker/_docker +++ /dev/null @@ -1 +0,0 @@ -#compdef diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker/docker.plugin.zsh b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker/docker.plugin.zsh deleted file mode 100644 index 6ffd179..0000000 --- a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker/docker.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -echo "sourcing docker.plugin.zsh..." -plugins+=(ohmy:docker) diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/extract/extract.plugin.zsh b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/extract/extract.plugin.zsh deleted file mode 100644 index 0631391..0000000 --- a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/extract/extract.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -echo "sourcing extract.plugin.zsh..." -plugins+=(ohmy:extract) diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos/functions/macos_func b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos/functions/macos_func deleted file mode 100644 index 2d31f90..0000000 --- a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos/functions/macos_func +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/zsh -function macos_func { - echo macos_func "$@" -} -macos_func "$@" diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos/macos.plugin.zsh b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos/macos.plugin.zsh deleted file mode 100644 index 443aa58..0000000 --- a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos/macos.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -echo "sourcing macos.plugin.zsh..." -plugins+=(ohmy:macos) diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter/magic-enter.plugin.zsh b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter/magic-enter.plugin.zsh deleted file mode 100644 index 47d800e..0000000 --- a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter/magic-enter.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -echo "sourcing magic-enter.plugin.zsh..." -plugins+=(ohmy:magic-enter) diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/themes/pretty.zsh-theme b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/themes/pretty.zsh-theme deleted file mode 100644 index 96e3a46..0000000 --- a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/themes/pretty.zsh-theme +++ /dev/null @@ -1,2 +0,0 @@ -echo "sourcing pretty.zsh-theme..." -themes=($themes ohmy:pretty) diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-zsh-defer/.mockgit/.gitkeep b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-zsh-defer/.mockgit/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh b/tests/zdotdir/antidote_home/https-COLON--SLASH--SLASH-github.com-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.com-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/tests/zdotdir/custom/lib/lib1.zsh b/tests/zdotdir/custom/lib/lib1.zsh deleted file mode 100644 index 1cf38dd..0000000 --- a/tests/zdotdir/custom/lib/lib1.zsh +++ /dev/null @@ -1,2 +0,0 @@ -echo "sourcing custom lib1.zsh..." -libs=($libs custom:lib1) diff --git a/tests/zdotdir/custom/lib/lib2.zsh b/tests/zdotdir/custom/lib/lib2.zsh deleted file mode 100644 index c858eed..0000000 --- a/tests/zdotdir/custom/lib/lib2.zsh +++ /dev/null @@ -1,2 +0,0 @@ -echo "sourcing custom lib2.zsh..." -libs=($libs custom:lib2) diff --git a/tests/zdotdir/custom/plugins/grizwold/grizwold.plugin.zsh b/tests/zdotdir/custom/plugins/grizwold/grizwold.plugin.zsh deleted file mode 100644 index 6f076cb..0000000 --- a/tests/zdotdir/custom/plugins/grizwold/grizwold.plugin.zsh +++ /dev/null @@ -1,187 +0,0 @@ -() { - setopt interactivecomments - typeset -ga grizwold_zopts=( - noaliases - aliasfuncdef - allexport - noalwayslastprompt - alwaystoend - appendcreate - noappendhistory - autocd - autocontinue - noautolist - noautomenu - autonamedirs - noautoparamkeys - noautoparamslash - autopushd - noautoremoveslash - autoresume - nobadpattern - nobanghist - nobareglobqual - bashautolist - bashrematch - nobeep - nobgnice - braceccl - bsdecho - nocaseglob - nocasematch - cbases - cdablevars - cdsilent - chasedots - chaselinks - nocheckjobs - nocheckrunningjobs - # noclobber - combiningchars - completealiases - completeinword - continueonerror - correct - correctall - cprecedences - cshjunkiehistory - cshjunkieloops - cshjunkiequotes - cshnullcmd - cshnullglob - nodebugbeforecmd - dvorak - emacs - noequals - # errexit - # errreturn - noevallineno - # noexec - extendedglob - extendedhistory - noflowcontrol - # forcefloat - nofunctionargzero - noglob - noglobalexport - # noglobalrcs - globassign - globcomplete - globdots - globstarshort - globsubst - nohashcmds - nohashdirs - hashexecutablesonly - nohashlistall - histallowclobber - nohistbeep - histexpiredupsfirst - histfcntllock - histfindnodups - histignorealldups - histignoredups - histignorespace - histlexwords - histnofunctions - histnostore - histreduceblanks - nohistsavebycopy - histsavenodups - histsubstpattern - histverify - nohup - ignorebraces - ignoreclosebraces - ignoreeof - incappendhistory - incappendhistorytime - # interactive - interactivecomments - # ksharrays - kshautoload - kshglob - # kshoptionprint - kshtypeset - kshzerosubscript - nolistambiguous - nolistbeep - listpacked - listrowsfirst - nolisttypes - localloops - # localoptions - localpatterns - localtraps - # login - longlistjobs - magicequalsubst - mailwarning - markdirs - menucomplete - # monitor - nomultibyte - nomultifuncdef - nomultios - nonomatch - nonotify - nullglob - numericglobsort - octalzeroes - overstrike - pathdirs - pathscript - pipefail - posixaliases - posixargzero - posixbuiltins - posixcd - posixidentifiers - posixjobs - # posixstrings - posixtraps - printeightbit - printexitvalue - # privileged - promptbang - nopromptcr - # nopromptpercent - nopromptsp - promptsubst - pushdignoredups - pushdminus - pushdsilent - pushdtohome - rcexpandparam - rcquotes - # norcs - recexact - rematchpcre - # restricted - rmstarsilent - rmstarwait - sharehistory - shfileexpansion - shglob - # shinstdin - shnullcmd - shoptionletters - noshortloops - shwordsplit - # singlecommand - singlelinezle - # sourcetrace - sunkeyboardhack - transientrprompt - trapsasync - typesetsilent - nounset - # verbose - # vi - warncreateglobal - warnnestedvar - # xtrace - # zle - ) - setopt $grizwold_zopts -} diff --git a/tests/zdotdir/custom/plugins/myplugin/myplugin.plugin.zsh b/tests/zdotdir/custom/plugins/myplugin/myplugin.plugin.zsh deleted file mode 100644 index 871e1c5..0000000 --- a/tests/zdotdir/custom/plugins/myplugin/myplugin.plugin.zsh +++ /dev/null @@ -1,3 +0,0 @@ -# fake foo/bar -echo "sourcing myplugin..." -plugins+=(custom:myplugin) diff --git a/tests/zdotdir/custom/plugins/mytheme/mytheme.zsh-theme b/tests/zdotdir/custom/plugins/mytheme/mytheme.zsh-theme deleted file mode 100644 index 51d3a8b..0000000 --- a/tests/zdotdir/custom/plugins/mytheme/mytheme.zsh-theme +++ /dev/null @@ -1,2 +0,0 @@ -echo "sourcing mytheme..." -plugins+=(custom:mytheme) diff --git a/tests/zdotdir/functions/myfunc b/tests/zdotdir/functions/myfunc deleted file mode 100644 index bb9ebd1..0000000 --- a/tests/zdotdir/functions/myfunc +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/zsh -function myfunc { - echo myfunc "$@" -} -myfunc "$@" From f3a86956b32ecad386d7bb0c9bb8016768962fce Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Thu, 18 Jul 2024 12:44:40 -0400 Subject: [PATCH 17/28] Update test data --- tests/testdata/.zplugins_fake_load.zsh | 46 ++++++------ .../.zplugins_fake_zcompile_static.zsh | 46 ++++++------ tests/testdata/.zsh_plugins.zsh | 44 ++++++------ tests/testdata/.zsh_plugins_multi_defer.zsh | 12 ++-- tests/testdata/.zsh_plugins_purged.txt | 2 +- tests/testdata/.zsh_plugins_repos.txt | 4 +- tests/testdata/real/.zsh_plugins.zsh | 72 +++++++++---------- tests/testdata/real/repo-list.txt | 30 ++++---- tests/testdata/script-bazqux.zsh | 2 - tests/testdata/script-fooqux.zsh | 2 + .../zsh-defer/zsh-defer.plugin.zsh | 4 +- tests/tmp_home/.zsh/.zplugins_fake_load | 29 ++++++++ tests/tmp_home/.zsh/.zsh_plugins.txt | 2 +- tests/tmp_home/.zsh/aliases.zsh | 1 + 14 files changed, 162 insertions(+), 134 deletions(-) delete mode 100644 tests/testdata/script-bazqux.zsh create mode 100644 tests/testdata/script-fooqux.zsh create mode 100644 tests/tmp_home/.zsh/.zplugins_fake_load create mode 100644 tests/tmp_home/.zsh/aliases.zsh 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.com-SLASH-foo-SLASH-bar ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/bar.plugin.zsh -fpath+=( $ANTIDOTE_HOME/git-AT-github.com-COLON-baz-SLASH-qux ) -source $ANTIDOTE_HOME/git-AT-github.com-COLON-baz-SLASH-qux/qux.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/bar.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar ) -export PATH="$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar:$PATH" -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib1.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib2.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib3.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/extract ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/extract/extract.plugin.zsh -fpath=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker $fpath ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker/docker.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter ) -zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter/magic-enter.plugin.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-foo-SLASH-bar ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/bar.plugin.zsh -fpath+=( $ANTIDOTE_HOME/git-AT-github.com-COLON-baz-SLASH-qux ) -source $ANTIDOTE_HOME/git-AT-github.com-COLON-baz-SLASH-qux/qux.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/bar.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar ) -export PATH="$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar:$PATH" -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib1.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib2.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib3.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/extract ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/extract/extract.plugin.zsh -fpath=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker $fpath ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker/docker.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter ) -zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter/magic-enter.plugin.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-foo-SLASH-bar ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/bar.plugin.zsh -fpath+=( $ANTIDOTE_HOME/git-AT-github.com-COLON-baz-SLASH-qux ) -source $ANTIDOTE_HOME/git-AT-github.com-COLON-baz-SLASH-qux/qux.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/bar.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar ) -export PATH="$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar:$PATH" -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib1.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib2.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib3.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/extract ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter ) -zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/magic-enter/magic-enter.plugin.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-zsh-users-SLASH-zsh-history-substring-search ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh + fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer ) + source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-syntax-highlighting ) zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-ohmy-SLASH-ohmy/plugins/macos/macos.plugin.zsh fi if ! (( $+functions[zsh-defer] )); then - fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh + fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer ) + source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions ) zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions/zsh-autosuggestions.plugin.zsh if ! (( $+functions[zsh-defer] )); then - fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh + fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer ) + source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zdharma-continuum-SLASH-fast-syntax-highlighting ) zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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 d7eb0fd..355d80f 100644 --- a/tests/testdata/.zsh_plugins_purged.txt +++ b/tests/testdata/.zsh_plugins_purged.txt @@ -4,7 +4,7 @@ $ZSH_CUSTOM path:plugins/myplugin # repo plugins # foo/bar -git@github.com:foo/quz.git # trailing comments +git@github.com:foo/qux.git # trailing comments # kind:clone getantidote/zsh-defer kind:clone # more trailing comments 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.com-SLASH-zsh-users-SLASH-zsh-history-substring-search ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-history-substring-search/zsh-history-substring-search.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions/zsh-autosuggestions.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-syntax-highlighting ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-sindresorhus-SLASH-pure ) -export PATH="$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-zsh-bench:$PATH" -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/gradle $fpath ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/gradle/gradle.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/docker ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/macos ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-mattmc3-SLASH-antidote ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-mattmc3-SLASH-antidote/pz.plugin.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/lib/clipboard.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/extract ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/extract/extract.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/magic-enter ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/magic-enter/magic-enter.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh/plugins/fancy-ctrl-z ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-zdharma-continuum-SLASH-fast-syntax-highlighting ) -zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zdharma-continuum-SLASH-fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-dracula-SLASH-zsh ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-dracula-SLASH-zsh/dracula.zsh-theme -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-peterhurford-SLASH-up.zsh ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-peterhurford-SLASH-up.zsh/up.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-rummik-SLASH-zsh-tailf ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-rummik-SLASH-zsh-tailf/tailf.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-rupa-SLASH-z ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-dracula-SLASH-zsh -https://github.com/mattmc3/antidote $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-mattmc3-SLASH-antidote -https://github.com/mattmc3/zman $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-mattmc3-SLASH-zman -https://github.com/ohmyzsh/ohmyzsh $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmyzsh-SLASH-ohmyzsh -https://github.com/peterhurford/up.zsh $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-peterhurford-SLASH-up.zsh -https://github.com/romkatv/zsh-bench $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-zsh-bench -https://github.com/romkatv/zsh-defer $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-zsh-defer -https://github.com/rummik/zsh-tailf $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-rummik-SLASH-zsh-tailf -https://github.com/rupa/z $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-rupa-SLASH-z -https://github.com/sindresorhus/pure $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-sindresorhus-SLASH-pure -https://github.com/zdharma-continuum/fast-syntax-highlighting $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zdharma-continuum-SLASH-fast-syntax-highlighting -https://github.com/zsh-users/antigen $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-antigen -https://github.com/zsh-users/zsh-autosuggestions $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions -https://github.com/zsh-users/zsh-history-substring-search $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-history-substring-search -https://github.com/zsh-users/zsh-syntax-highlighting $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-COLON-baz-SLASH-qux ) -source $ANTIDOTE_HOME/git-AT-github.com-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.com-COLON-foo-SLASH-qux ) +source $ANTIDOTE_HOME/git-AT-github.com-COLON-foo-SLASH-qux/qux.plugin.zsh 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 index 841cee6..20a8508 100644 --- 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 @@ -1,6 +1,6 @@ # fake foo/bar -echo "sourcing romkatv/zsh-defer..." -plugins=($plugins romkatv/zsh-defer) +echo "sourcing getantidote/zsh-defer..." +plugins=($plugins getantidote/zsh-defer) function zsh-defer { $@ } diff --git a/tests/tmp_home/.zsh/.zplugins_fake_load b/tests/tmp_home/.zsh/.zplugins_fake_load new file mode 100644 index 0000000..8ed19d0 --- /dev/null +++ b/tests/tmp_home/.zsh/.zplugins_fake_load @@ -0,0 +1,29 @@ +# repo plugins +foo/bar +git@github.com:foo/qux.git # trailing comments + +# kind:clone +getantidote/zsh-defer kind:clone # more trailing comments + +# kind:zsh +foo/bar kind:zsh + +# kind:fpath +foo/bar kind:fpath + +# kind:path +foo/bar kind:path + +# subpath plugins +ohmy/ohmy path:lib +ohmy/ohmy path:plugins/extract + +# fpath-rule +ohmy/ohmy path:plugins/docker fpath-rule:prepend +ohmy/ohmy path:plugins/docker fpath-rule:append + +# deferred +ohmy/ohmy path:plugins/magic-enter kind:defer + +# theme +ohmy/ohmy path:custom/themes/pretty.zsh-theme diff --git a/tests/tmp_home/.zsh/.zsh_plugins.txt b/tests/tmp_home/.zsh/.zsh_plugins.txt index 4d23dba..1ebc6db 100644 --- a/tests/tmp_home/.zsh/.zsh_plugins.txt +++ b/tests/tmp_home/.zsh/.zsh_plugins.txt @@ -4,7 +4,7 @@ $ZSH_CUSTOM path:plugins/myplugin # repo plugins foo/bar -git@github.com:foo/quz.git # trailing comments +git@github.com:foo/qux.git # trailing comments # kind:clone getantidote/zsh-defer kind:clone # more trailing comments diff --git a/tests/tmp_home/.zsh/aliases.zsh b/tests/tmp_home/.zsh/aliases.zsh new file mode 100644 index 0000000..df95e4a --- /dev/null +++ b/tests/tmp_home/.zsh/aliases.zsh @@ -0,0 +1 @@ +echo "sourcing aliases.zsh..." From 286fc7241d3e3072bf918a6c5f06e5e9fed488fc Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Thu, 18 Jul 2024 12:44:54 -0400 Subject: [PATCH 18/28] Update test functions --- tests/functions/is-macos | 2 -- tests/functions/subenv | 17 ++++++++++++----- tests/functions/t_setup | 29 ++++++++++++++++++++--------- tests/functions/t_setup_real | 3 +++ tests/functions/t_teardown | 24 ++++++++++++++++++------ tests/functions/t_unload_antidote | 13 +++++++++++++ 6 files changed, 66 insertions(+), 22 deletions(-) delete mode 100644 tests/functions/is-macos create mode 100644 tests/functions/t_unload_antidote 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/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..93af2d5 100644 --- a/tests/functions/t_setup_real +++ b/tests/functions/t_setup_real @@ -8,6 +8,9 @@ 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 diff --git a/tests/functions/t_teardown b/tests/functions/t_teardown index 56db9ec..684fd86 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" + + # 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 From e86ec8d310de6aa06df841da42cae3bcd8cbdfa9 Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Thu, 18 Jul 2024 12:45:50 -0400 Subject: [PATCH 19/28] Update tests --- tests/test_alt_zsh_defer_bundle.md | 10 ++-- tests/test_bundle_helpers.md | 17 +++--- tests/test_cmd_bundle.md | 10 +++- tests/test_cmd_init.md | 4 +- tests/test_cmd_install.md | 2 +- tests/test_cmd_list.md | 32 +++++------ tests/test_cmd_load.md | 10 ++-- tests/test_cmd_main.md | 4 +- tests/test_cmd_path.md | 16 +++--- tests/test_cmd_purge.md | 12 ++-- tests/test_cmd_script.md | 91 ++++++++++++++++-------------- tests/test_cmd_update.md | 6 +- tests/test_helpers.md | 9 +-- tests/test_real.md | 32 +++++------ tests/test_zcompile_bundle.md | 10 ++-- tests/test_zsetopts.md | 4 +- 16 files changed, 139 insertions(+), 130 deletions(-) diff --git a/tests/test_alt_zsh_defer_bundle.md b/tests/test_alt_zsh_defer_bundle.md index 5a90701..1590bdc 100644 --- a/tests/test_alt_zsh_defer_bundle.md +++ b/tests/test_alt_zsh_defer_bundle.md @@ -17,13 +17,13 @@ If the user forks zsh-defer, support setting a zstyle for an alternative repo lo ```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 | subenv ANTIDOTE_HOME +% antidote bundle 'zsh-users/zsh-autosuggestions kind:defer' 2>/dev/null if ! (( $+functions[zsh-defer] )); then - fpath+=( $ANTIDOTE_HOME/custom/zsh-defer ) - source $ANTIDOTE_HOME/custom/zsh-defer/zsh-defer.plugin.zsh + fpath+=( $HOME/.cache/antidote/custom/zsh-defer ) + source $HOME/.cache/antidote/custom/zsh-defer/zsh-defer.plugin.zsh fi -fpath+=( $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions ) -zsh-defer source $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh +fpath+=( $HOME/.cache/antidote/zsh-users/zsh-autosuggestions ) +zsh-defer source $HOME/.cache/antidote/zsh-users/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh % ``` 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.com-SLASH-zsh-users-SLASH-zsh-history-substring-search ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-zsh-defer/zsh-defer.plugin.zsh + fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer ) + source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-syntax-highlighting ) zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-foo-SLASH-bar ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-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.com-COLON-baz-SLASH-qux -$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-bar-SLASH-baz -$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar -$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy -$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-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.com-COLON-baz-SLASH-qux -https://github.com/bar/baz $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-bar-SLASH-baz -https://github.com/foo/bar $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar -https://github.com/ohmy/ohmy $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy -https://github.com/romkatv/zsh-defer $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-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.com-SLASH-bar-SLASH-baz -$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar -$ANTIDOTE_HOME/git-AT-github.com-COLON-baz-SLASH-qux -$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy -$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-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.com-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.com-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.com-COLON-baz-SLASH-qux -https://github.com/bar/baz $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-bar-SLASH-baz -https://github.com/ohmy/ohmy $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy -https://github.com/romkatv/zsh-defer $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-foo-SLASH-bar ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-foo-SLASH-bar/b ```zsh % antidote-script --kind path foo/bar | subenv ANTIDOTE_HOME -export PATH="$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-foo-SLASH ```zsh % antidote-script --kind fpath foo/bar | subenv ANTIDOTE_HOME -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-foo-SLASH-bar ) -zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-foo-SLASH-bar ) -zsh-defer -p source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-bar-SLASH-baz ) -zsh-defer -a source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-ba ```zsh % antidote-script --path plugins/extract ohmy/ohmy | subenv ANTIDOTE_HOME -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/extract ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-ohmy-SLASH-ohmy ```zsh % antidote-script --path lib/lib1.zsh ohmy/ohmy | subenv ANTIDOTE_HOME -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-ohmy-SLASH-ohmy ```zsh % antidote-script --path lib ohmy/ohmy | subenv ANTIDOTE_HOME -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib1.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/lib/lib2.zsh -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-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.com-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.com-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.com-SLASH-ohmy-SLASH-ohmy/plugins/macos ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-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.com-SLASH-ohmy-SLASH-ohmy/plugins/macos ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-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.com-SLASH-ohmy-SLASH-ohmy/plugins/docker ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-ohmy-SLASH-ohmy/plugins/docker $fpath ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-foo-SLASH-bar ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-foo-SLASH-bar ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-romkatv-SLASH-zsh-defer ) - source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-foo-SLASH-bar ) -zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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_update.md b/tests/test_cmd_update.md index 88bde39..be7a216 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. diff --git a/tests/test_helpers.md b/tests/test_helpers.md index 03266bd..f7472ee 100644 --- a/tests/test_helpers.md +++ b/tests/test_helpers.md @@ -106,6 +106,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.com-SLASH-foo-SLASH-bar @@ -138,8 +139,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 +181,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.com-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.com-SLASH-rupa-SLASH-z ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-rupa-SLASH-z/z.sh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-syntax-highlighting ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-completions ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-completions/zsh-completions.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions/zsh-autosuggestions.plugin.zsh -fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-history-substring-search ) -source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-SLASH-rupa-SLASH-z -https://github.com/zsh-users/zsh-autosuggestions $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions -https://github.com/zsh-users/zsh-completions $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-completions -https://github.com/zsh-users/zsh-history-substring-search $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-history-substring-search -https://github.com/zsh-users/zsh-syntax-highlighting $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-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.com-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 % ``` From 73be192f9afc54a5c8509c87e9a61ef8593b4786 Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Thu, 18 Jul 2024 12:46:31 -0400 Subject: [PATCH 20/28] Add simple master test that also serves as proper usage docs --- tests/test_antidote.md | 302 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 302 insertions(+) create mode 100644 tests/test_antidote.md diff --git a/tests/test_antidote.md b/tests/test_antidote.md new file mode 100644 index 0000000..6c9ab45 --- /dev/null +++ b/tests/test_antidote.md @@ -0,0 +1,302 @@ +# antidote bundle tests + +## Setup + +```zsh +% source ./tests/_setup.zsh +% source ./antidote.zsh +% +``` + +## Version + +Show antidote's version: + +```zsh +% antidote --version +antidote version 1.9.6 +% +``` + +## Help + +Show antidote's functionality: + +```zsh +% antidote --help +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 +% +``` + +## Bundling + +Bundle the foo/bar repo using old antibody style directories: + +```zsh +% zstyle ':antidote:bundle' use-friendly-names off +% antidote bundle foo/bar +# antidote cloning foo/bar... +fpath+=( $HOME/.cache/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar ) +source $HOME/.cache/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/bar.plugin.zsh +% +``` + +Use new-style directory naming: + +```zsh +% zstyle ':antidote:bundle' use-friendly-names on +% +``` + +Bundle a repo at https://github.com/foo/bar + +```zsh +% antidote bundle foo/bar +fpath+=( $HOME/.cache/antidote/foo/bar ) +source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh +% +``` + +Bundle a repo at git@bitbucket.org:foo/bar + +```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 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 +% +``` + +Use `path:` to load a specific file. + +```zsh +% antidote bundle ohmy/ohmy path:custom/themes/pretty.zsh-theme +source $HOME/.cache/antidote/ohmy/ohmy/custom/themes/pretty.zsh-theme +% +``` + +### Annotations: conditional + +Use a existing boolean function to wrap a bundle in `if` logic: + +```zsh +% 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 +% +``` + +## Dynamic bundling + +If you run `source <(antidote init)`, antidote will emit a wrapper so that you can +dynamically bundle. + +```zsh +% 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.6 +% +``` + +## Teardown + +```zsh +% t_teardown +% +``` From e0ea712ae09da97e5e8663397834bcde0f120583 Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Thu, 18 Jul 2024 12:48:03 -0400 Subject: [PATCH 21/28] Pretty print bundle output with `$HOME` variable --- functions/__antidote_print_path | 3 +++ functions/antidote-script | 21 +++++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 functions/__antidote_print_path diff --git a/functions/__antidote_print_path b/functions/__antidote_print_path new file mode 100644 index 0000000..e193828 --- /dev/null +++ b/functions/__antidote_print_path @@ -0,0 +1,3 @@ +#!/bin/zsh +### Pretty print a path +echo "$1" | sed -e "s|^$HOME/|\$HOME/|" diff --git a/functions/antidote-script b/functions/antidote-script index aa78132..718f499 100644 --- a/functions/antidote-script +++ b/functions/antidote-script @@ -119,6 +119,9 @@ ) 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 @@ -133,9 +136,9 @@ 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 @@ -143,7 +146,7 @@ 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+=( @@ -155,18 +158,24 @@ __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 From 773dd7b2b125596be41da6557b2547f79a1d440a Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Thu, 18 Jul 2024 12:48:13 -0400 Subject: [PATCH 22/28] Fix fpath rules --- functions/antidote-script | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/functions/antidote-script b/functions/antidote-script index 718f499..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 @@ -125,11 +132,12 @@ # 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 @@ -149,10 +157,12 @@ 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 From f6117f4a3f397b47ebbd5ba355690cb3fe1fb475 Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Thu, 18 Jul 2024 12:48:19 -0400 Subject: [PATCH 23/28] Add fpath rule tests --- tests/test_fpath_rules.md | 111 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 tests/test_fpath_rules.md 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 +% +``` From 3b2de5a0da3afdcd90aac7a11b10c0b0a07b193b Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Thu, 18 Jul 2024 14:38:46 -0400 Subject: [PATCH 24/28] Ensure `rm` and `mv` always use the base command --- functions/antidote-purge | 4 ++-- functions/antidote-update | 6 +++++- tests/functions/t_setup_real | 6 +++--- tests/functions/t_teardown | 2 +- tools/buildman | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/functions/antidote-purge b/functions/antidote-purge index c4d16c0..6fe08f2 100644 --- a/functions/antidote-purge +++ b/functions/antidote-purge @@ -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 @@ -75,7 +75,7 @@ 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" || command rm -f "$tmpfile" print "Bundle '$bundle' was commented out in '$bundlefile'." fi fi diff --git a/functions/antidote-update b/functions/antidote-update index ff775eb..a72ce33 100644 --- a/functions/antidote-update +++ b/functions/antidote-update @@ -37,7 +37,11 @@ local bundledir url repo # remove zcompiled files - rm -rf -- $(antidote-home)/**/*.zwc(N) + command rm -rf -- $(antidote-home)/**/*.zwc(N) + + # remove check file + local loadable_check_path="$(antidote-home)/.antidote.load" + [[ -r "$loadable_check_path" ]] && command rm -- "$loadable_check_path" # update all bundles for bundledir in $(antidote-list --dirs); do diff --git a/tests/functions/t_setup_real b/tests/functions/t_setup_real index 93af2d5..1bfc0e7 100644 --- a/tests/functions/t_setup_real +++ b/tests/functions/t_setup_real @@ -17,12 +17,12 @@ # 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 684fd86..24eae4f 100644 --- a/tests/functions/t_teardown +++ b/tests/functions/t_teardown @@ -26,7 +26,7 @@ source <(printf '%s\n' $T_PREV_ZSTYLES) # remove tempdir - [[ -d "$T_TEMPDIR" ]] && rm -rf -- "$T_TEMPDIR" + [[ -d "$T_TEMPDIR" ]] && command rm -rf -- "$T_TEMPDIR" # remove vars for var in \ diff --git a/tools/buildman b/tools/buildman index 8f263e3..3c2e0b8 100755 --- a/tools/buildman +++ b/tools/buildman @@ -7,7 +7,7 @@ 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() { From 6cf8d24d5e195b0d15c308f20069efc595bd0cbc Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Thu, 18 Jul 2024 15:54:39 -0400 Subject: [PATCH 25/28] Add rm wrapper `__antidote_del` --- functions/__antidote_del | 32 ++++++++++++++++++++++++++++++++ functions/__antidote_load_prep | 2 +- functions/antidote-purge | 6 +++--- functions/antidote-update | 4 ++-- tests/test_helpers.md | 10 ++++++++++ 5 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 functions/__antidote_del 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-purge b/functions/antidote-purge index 6fe08f2..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' || { @@ -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 - command mv -f "$tmpfile" "$bundlefile" || command 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-update b/functions/antidote-update index a72ce33..2daed4d 100644 --- a/functions/antidote-update +++ b/functions/antidote-update @@ -37,11 +37,11 @@ local bundledir url repo # remove zcompiled files - command 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" ]] && command rm -- "$loadable_check_path" + [[ -r "$loadable_check_path" ]] && __antidote_del -- "$loadable_check_path" # update all bundles for bundledir in $(antidote-list --dirs); do diff --git a/tests/test_helpers.md b/tests/test_helpers.md index f7472ee..fbd9aca 100644 --- a/tests/test_helpers.md +++ b/tests/test_helpers.md @@ -8,6 +8,16 @@ % ``` +## 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'. +% +``` + ## Bundle type ```zsh From 95c75f7f0546c6a197a2318fdebd9f7d7fe02634 Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Thu, 18 Jul 2024 17:26:05 -0400 Subject: [PATCH 26/28] Bump version to 1.9.7 --- .bumpversion.cfg | 2 +- README.md | 2 +- functions/__antidote_version | 2 +- tests/README.md | 2 +- tests/test_antidote.md | 4 ++-- tests/test_antidote_core.md | 2 +- tests/test_cmd_update.md | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 86d95b0..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} diff --git a/README.md b/README.md index 7954adf..a96814c 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) /dev/null) [[ -z "$gitsha" ]] || ver="$ver ($gitsha)" print "antidote version $ver" 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/test_antidote.md b/tests/test_antidote.md index 6c9ab45..24770a0 100644 --- a/tests/test_antidote.md +++ b/tests/test_antidote.md @@ -14,7 +14,7 @@ Show antidote's version: ```zsh % antidote --version -antidote version 1.9.6 +antidote version 1.9.7 % ``` @@ -290,7 +290,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_antidote_core.md b/tests/test_antidote_core.md index b126832..decd967 100644 --- a/tests/test_antidote_core.md +++ b/tests/test_antidote_core.md @@ -79,7 +79,7 @@ No arg exit status is 2: ```zsh % antidote --version -antidote version 1.9.6 +antidote version 1.9.7 % antidote -v >/dev/null; echo $? 0 % antidote --version >/dev/null; echo $? diff --git a/tests/test_cmd_update.md b/tests/test_cmd_update.md index be7a216..be16a09 100644 --- a/tests/test_cmd_update.md +++ b/tests/test_cmd_update.md @@ -25,7 +25,7 @@ Bundle updates complete. Updating antidote... antidote self-update complete. -antidote version 1.9.6 +antidote version 1.9.7 % ``` From e305f98eb2f66b887148fc12f52adb6a3b034fb9 Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Thu, 18 Jul 2024 17:53:40 -0400 Subject: [PATCH 27/28] Update readme --- README.md | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index a96814c..eea62f1 100644 --- a/README.md +++ b/README.md @@ -14,27 +14,44 @@ > [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.com-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.com-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 From f828798028756764e4150f53fe21ec251a0559da Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Thu, 18 Jul 2024 18:01:28 -0400 Subject: [PATCH 28/28] Only emit $HOME when not in compatibility mode --- functions/__antidote_print_path | 7 ++++++- tests/test_helpers.md | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/functions/__antidote_print_path b/functions/__antidote_print_path index e193828..9bce65b 100644 --- a/functions/__antidote_print_path +++ b/functions/__antidote_print_path @@ -1,3 +1,8 @@ #!/bin/zsh ### Pretty print a path -echo "$1" | sed -e "s|^$HOME/|\$HOME/|" + +if zstyle -t ':antidote:compatibility-mode' 'antibody'; then + echo "$1" +else + echo "$1" | sed -e "s|^$HOME/|\$HOME/|" +fi diff --git a/tests/test_helpers.md b/tests/test_helpers.md index fbd9aca..6234cbb 100644 --- a/tests/test_helpers.md +++ b/tests/test_helpers.md @@ -18,6 +18,20 @@ 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