pax_global_header00006660000000000000000000000064150064052210014505gustar00rootroot0000000000000052 comment=6ed9275b8f1711095cb8b85b874978fe5e0b4220 antidote-1.9.10/000077500000000000000000000000001500640522100134045ustar00rootroot00000000000000antidote-1.9.10/.bumpversion.cfg000066400000000000000000000006051500640522100165150ustar00rootroot00000000000000[bumpversion] current_version = 1.9.10 parse = v?(?P\d+)\.(?P\d+)\.(?P\d+) serialize = {major}.{minor}.{revision} [bumpversion:file:functions/__antidote_version] [bumpversion:file:tests/README.md] [bumpversion:file:tests/test_antidote.md] [bumpversion:file:tests/test_antidote_core.md] [bumpversion:file:tests/test_cmd_update.md] [bumpversion:file:README.md] antidote-1.9.10/.editorconfig000066400000000000000000000004121500640522100160560ustar00rootroot00000000000000root = true [*] charset = utf-8 end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true indent_style = space indent_size = 2 [*.crlf.*] end_of_line = crlf [*.md] trim_trailing_whitespace = false [makefile] indent_style = tab indent_size = 4 antidote-1.9.10/.github/000077500000000000000000000000001500640522100147445ustar00rootroot00000000000000antidote-1.9.10/.github/CODE_OF_CONDUCT.md000066400000000000000000000064531500640522100175530ustar00rootroot00000000000000 # Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies within all project spaces, and it also applies when an individual is representing the project or its community in public spaces. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at getantidote@gmail.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq antidote-1.9.10/.github/workflows/000077500000000000000000000000001500640522100170015ustar00rootroot00000000000000antidote-1.9.10/.github/workflows/test-zsh-5.4.2.yml000066400000000000000000000015231500640522100217520ustar00rootroot00000000000000name: test-zsh-5.4.2 on: push: pull_request: workflow_dispatch: jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/checkout@v3 with: repository: "aureliojargas/clitest" path: bin/clitest - run: | sudo apt update sudo apt install -y wget build-essential libncursesw5-dev wget https://sourceforge.net/projects/zsh/files/zsh/5.4.2/zsh-5.4.2.tar.xz tar -xf zsh-5.4.2.tar.xz cd zsh-5.4.2 ./configure --with-tcsetpgrp make sudo make install - run: | which zsh zsh --version name: Verify Zsh Installation - run: | export PATH=$GITHUB_WORKSPACE/bin/clitest:$PATH export ZSH_BINARY=/usr/local/bin/zsh make test antidote-1.9.10/.github/workflows/test.yml000066400000000000000000000007701500640522100205070ustar00rootroot00000000000000name: test on: push: pull_request: workflow_dispatch: jobs: test: strategy: matrix: os: [macos-latest, ubuntu-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - uses: actions/checkout@v3 with: repository: "aureliojargas/clitest" path: bin/clitest - run: sudo apt install zsh if: ${{ runner.os == 'Linux' }} - run: PATH=$GITHUB_WORKSPACE/bin/clitest:$PATH make test shell: zsh {0} antidote-1.9.10/.gitignore000066400000000000000000000001721500640522100153740ustar00rootroot00000000000000~* *.zwc *.zwc.old .cache/ !/tests/**/.cache/ .tmp/ .plugins/ .todo/ sandbox/ *.old **/realzdotdir/zsh_plugins.zsh foo*.* antidote-1.9.10/LICENSE000066400000000000000000000021431500640522100144110ustar00rootroot00000000000000MIT License Copyright (c) 2015-2017 Carlos Alexandro Becker Copyright (c) 2021-2024 Matt McElheny Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. antidote-1.9.10/README.md000066400000000000000000000125541500640522100146720ustar00rootroot00000000000000# antidote [![MIT License](https://img.shields.io/badge/license-MIT-007EC7.svg)](/LICENSE) ![version](https://img.shields.io/badge/version-v1.9.10-df5e88) GetAntidote Logo > [Get the cure][antidote] [Antidote][antidote] 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: ```zsh 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. - 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. ## 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`. ```zsh # .zsh_plugins.txt rupa/z # some bash plugins work too sindresorhus/pure # enhance your prompt # you can even use Oh My Zsh plugins getantidote/use-omz ohmyzsh/ohmyzsh path:lib ohmyzsh/ohmyzsh path:plugins/extract # add fish-like features zsh-users/zsh-syntax-highlighting zsh-users/zsh-autosuggestions zsh-users/zsh-history-substring-search ``` A typical `.zshrc` might then look like: ```zsh # .zshrc source /path-to-antidote/antidote.zsh antidote load ${ZDOTDIR:-$HOME}/.zsh_plugins.txt ``` The full documentation can be found at [https://antidote.sh][antidote]. ## 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. ## Installation ### Install with git You can install the latest release of antidote by cloning it with `git`: ```zsh # first, run this from an interactive zsh terminal session: git clone --depth=1 https://github.com/mattmc3/antidote.git ${ZDOTDIR:-$HOME}/.antidote ``` ### Install with a package manager antidote may also be available in your system's package manager: - [macOS homebrew](https://formulae.brew.sh/formula/antidote): `brew install antidote` - [Arch AUR](https://aur.archlinux.org/packages/zsh-antidote): `yay -S zsh-antidote` - [Nix Home-Manager](https://mipmip.github.io/home-manager-option-search/?query=antidote) : `programs.zsh.antidote.enable = true;` ## Performance antidote supports ultra-high performance plugin loads using a static plugin file. It also allows deferred loading for [plugins that support it](https://github.com/romkatv/zsh-defer#caveats). ```zsh # .zsh_plugins.txt # some plugins support deferred loading zdharma-continuum/fast-syntax-highlighting kind:defer zsh-users/zsh-autosuggestions kind:defer zsh-users/zsh-history-substring-search kind:defer ``` ```zsh # .zshrc # Lazy-load antidote and generate the static load file only when needed zsh_plugins=${ZDOTDIR:-$HOME}/.zsh_plugins if [[ ! ${zsh_plugins}.zsh -nt ${zsh_plugins}.txt ]]; then ( source /path-to-antidote/antidote.zsh antidote bundle <${zsh_plugins}.txt >${zsh_plugins}.zsh ) fi source ${zsh_plugins}.zsh ``` ## Benchmarks You can see how antidote compares with other setups [here][benchmarks]. ## Plugin authors If you authored a Zsh plugin, the recommended snippet for antidote is: ```zsh antidote install gh_user/gh_repo ``` If your plugin is hosted somewhere other than GitHub, you can use this: ```zsh antidote install https://bitbucket.org/bb_user/bb_repo ``` ## Credits 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 [antibody]: https://github.com/getantibody/antibody [antidote]: https://antidote.sh [benchmarks]: https://github.com/romkatv/zsh-bench/blob/master/doc/linux-desktop.md [zsh]: https://www.zsh.org antidote-1.9.10/antidote000066400000000000000000000005231500640522100151360ustar00rootroot00000000000000#!/bin/zsh ### antidote - the cure to slow zsh plugin management # # https://antidote.sh # run `antidote -h` for usage # # Note: this gets overridden if using `antidote init`. # function antidote { 0=${(%):-%x} if ! typeset -f antidote-main > /dev/null; then source ${0:A:h}/antidote.zsh fi antidote-main "$@" } antidote "$@" antidote-1.9.10/antidote.zsh000066400000000000000000000010051500640522100157350ustar00rootroot00000000000000# shell prereq if test -z "$ZSH_VERSION"; then shellname=$(ps -p $$ -oargs= | awk 'NR=1{print $1}') echo >&2 "antidote: Expecting zsh. Found '$shellname'." return 1 else builtin autoload -Uz is-at-least if ! is-at-least 5.4.2; then echo >&2 "antidote: Unsupported Zsh version '$ZSH_VERSION'. Expecting Zsh >5.4.2." return 1 fi typeset -f __antidote_setup &>/dev/null && unfunction __antidote_setup 0=${(%):-%N} builtin autoload -Uz ${0:A:h}/functions/__antidote_setup __antidote_setup fi antidote-1.9.10/functions/000077500000000000000000000000001500640522100154145ustar00rootroot00000000000000antidote-1.9.10/functions/__antidote_bulk_clone000066400000000000000000000021211500640522100216350ustar00rootroot00000000000000#!/bin/zsh ### Generate background clone commands #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 -v ZSH_DEFER_BUNDLE=$zsh_defer_bundle ' BEGIN { RS="[\r\n]" } # initialize vars { bundle=""; opts="--kind clone" } # skip blank or commented lines /^ *(#.+)?$/ { next } # clone zsh-defer /kind:defer/ { print "antidote-script --kind clone " ZSH_DEFER_BUNDLE " &" } # handle user/repo and URL forms $1~/^[^\/]+\/[^\/]+$/ { bundle=$1 } $1~/^(https?:|(ssh|git)@)/ { bundle=$1 } # find branch annotation if it exists match($0, /branch:[^\t ]+/) { opts=opts " --branch " substr($0, RSTART+7, RLENGTH-7) } # print result bundle!=""{ print "antidote-script", opts, bundle, "&" } END { print "wait" } ' "$@" | sort | uniq #} antidote-1.9.10/functions/__antidote_bundle_dir000066400000000000000000000032211500640522100216310ustar00rootroot00000000000000#!/bin/zsh ### Get the name of the bundle dir. #function __antidote_bundle_dir { emulate -L zsh; setopt local_options $_adote_funcopts # If the bundle is a repo/URL, then by default we use the legacy antibody format: # `$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions` # With `zstyle ':antidote:bundle' use-friendly-names on`, we can simplify to # `$ANTIDOTE_HOME/zsh-users/zsh-autosuggestions` # If the bundle is a file, use its parent directory. # Otherwise, just assume the bundle is a directory. local MATCH MBEGIN MEND; local -a match mbegin mend # appease 'warn_create_global' local bundle="$1" local bundle_type="$(__antidote_bundle_type $bundle)" # handle repo bundle paths if [[ "$bundle_type" == (repo|url|sshurl) ]] && [[ ! -e "$bundle_path" ]]; then if zstyle -t ':antidote:bundle' use-friendly-names; then # user/repo format # ex: $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions bundle=${bundle%.git} bundle=${bundle:gs/\:/\/} local parts=( ${(ps./.)bundle} ) if [[ $#parts -gt 1 ]]; then print $(antidote-home)/${parts[-2]}/${parts[-1]} else print $(antidote-home)/$bundle fi else # sanitize URL for safe use as a dir name # ex: $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions local url=$(__antidote_tourl $bundle) url=${url%.git} url=${url:gs/\@/-AT-} url=${url:gs/\:/-COLON-} url=${url:gs/\//-SLASH-} print $(antidote-home)/$url fi elif [[ -f "$bundle" ]]; then print ${bundle:A:h} else print ${bundle} fi #} antidote-1.9.10/functions/__antidote_bundle_name000066400000000000000000000011621500640522100217750ustar00rootroot00000000000000#!/bin/zsh ### Get the short name of the bundle. #function __antidote_bundle_name { emulate -L zsh; setopt local_options $_adote_funcopts local MATCH MBEGIN MEND; local -a match mbegin mend # appease 'warn_create_global' local bundle=$1 local bundle_type="$(__antidote_bundle_type $bundle)" if [[ "$bundle_type" == (url|sshurl) ]] ; then bundle=${bundle%.git} bundle=${bundle:gs/\:/\/} local parts=(${(ps./.)bundle}) print ${parts[-2]}/${parts[-1]} else # Replace ~ and $HOME with \$HOME bundle=${bundle/#\~\//\$HOME/} bundle=${bundle/#$HOME/\$HOME} print -r -- "$bundle" fi #} antidote-1.9.10/functions/__antidote_bundle_type000066400000000000000000000025351500640522100220430ustar00rootroot00000000000000#!/bin/zsh ### Determine bundle type: ### - ? - unknown ### - empty - empty string ### - file - an existing file ### - dir - an existing directory ### - path - an non-existant path ### - relpath - a relative path ### - repo - a git repo (user/repo format) ### - sshurl - a git repo (SSH format) ### - url - a git repo (URL format) ### - word - a word #function __antidote_bundle_type { emulate -L zsh; setopt local_options $_adote_funcopts local bundle=$1 # Try to expand path bundles with '$' and '~' prefixes so that we get a more # granular result than 'path'. if [[ $bundle == '~/'* ]]; then bundle="${HOME}/${bundle#\~/*}" elif [[ $bundle == '$'* ]] && [[ $bundle != *'('* ]] && [[ $bundle != *';'* ]]; then bundle=$(eval print $bundle) fi # Determine the bundle type. local result if [[ -e "$bundle" ]]; then [[ -f $bundle ]] && result=file || result=dir elif [[ -z "${bundle// }" ]]; then result=empty else case "$bundle" in (/|~|'$')*) result=path ;; *://*) result=url ;; *@*:*/*) result=sshurl ;; *(:|@)*) result='?' ;; */*/*) result=relpath ;; */) result=relpath ;; */*) result=repo ;; *) result=word ;; esac fi typeset -g REPLY=$result print $result #} antidote-1.9.10/functions/__antidote_bundle_zcompile000066400000000000000000000011271500640522100227000ustar00rootroot00000000000000#!/bin/zsh ### Compile bundles #function __antidote_bundle_zcompile { emulate -L zsh; setopt local_options $_adote_funcopts builtin autoload -Uz zrecompile local -a bundles if [[ -z "$1" ]]; then bundles=($(antidote-list --dirs)) elif [[ -f "$1" ]]; then zrecompile -pq "$1" return elif [[ -d "$1" ]]; then bundles=($1) else bundles=($(antidote-path "$1")) fi local bundle zfile for bundle in $bundles; do for zfile in ${bundle}/**/*.zsh{,-theme}(N); do [[ $zfile != */test-data/* ]] || continue zrecompile -pq "$zfile" done done # } antidote-1.9.10/functions/__antidote_collect_input000066400000000000000000000005051500640522100223700ustar00rootroot00000000000000#!/bin/zsh ### Collect 0 )); then input=("${(s.\n.)${@}}") elif [[ ! -t 0 ]]; then local data while IFS= read -r data || [[ -n "$data" ]]; do input+=("$data") done fi printf '%s\n' "${input[@]}" #} antidote-1.9.10/functions/__antidote_del000066400000000000000000000016521500640522100202740ustar00rootroot00000000000000#!/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 local tmpdir if [[ -n "$TMPDIR" && (( -d "$TMPDIR" && -w "$TMPDIR" ) || ! ( -d /tmp && -w /tmp )) ]]; then tmpdir="${TMPDIR%/}" else tmpdir="/tmp" fi for p in $@; do p="${p:a}" if [[ "$p" != ${HOME}/* ]] && [[ "$p" != ${tmpdir}/* ]]; then print -ru2 -- "antidote: Blocked attempt to rm path: '$p'." return 1 fi done command rm ${rmflags[@]} -- "$@" #} antidote-1.9.10/functions/__antidote_get_cachedir000066400000000000000000000012501500640522100221230ustar00rootroot00000000000000#!/bin/zsh ### Get the default cache directory per OS #function __antidote_get_cachedir { emulate -L zsh; setopt local_options $_adote_funcopts local result if [[ "${OSTYPE}" == darwin* ]]; then result=$HOME/Library/Caches elif [[ "${OSTYPE}" == (cygwin|msys)* ]]; then result=${LOCALAPPDATA:-$LocalAppData} if type cygpath > /dev/null; then result=$(cygpath "$result") fi elif [[ -n "$XDG_CACHE_HOME" ]]; then result=$XDG_CACHE_HOME else result=$HOME/.cache fi if [[ -n "$1" ]]; then if [[ $result == *\\* ]] && [[ $result != */* ]]; then result+="\\$1" else result+="/$1" fi fi print -r -- $result #} antidote-1.9.10/functions/__antidote_indent000066400000000000000000000003161500640522100210050ustar00rootroot00000000000000#!/bin/zsh ### Indent strings #function __antidote_indent { emulate -L zsh; setopt local_options $_adote_funcopts local -a lines=("${(@f)$(__antidote_collect_input "$@")}") printf ' %s\n' $lines #} antidote-1.9.10/functions/__antidote_initfiles000066400000000000000000000010731500640522100215130ustar00rootroot00000000000000#!/bin/zsh ### Get the path to a plugin's init file. #function __antidote_initfiles { emulate -L zsh; setopt local_options $_adote_funcopts typeset -ga reply=() local dir=${1:A} local initfiles=($dir/${dir:A:t}.plugin.zsh(N)) [[ $#initfiles -gt 0 ]] || initfiles=($dir/*.plugin.zsh(N)) [[ $#initfiles -gt 0 ]] || initfiles=($dir/*.zsh(N)) [[ $#initfiles -gt 0 ]] || initfiles=($dir/*.sh(N)) [[ $#initfiles -gt 0 ]] || initfiles=($dir/*.zsh-theme(N)) typeset -ga reply=($initfiles) printf "%s\n" ${(u)initfiles[@]} (( $#initfiles )) || return 1 #} antidote-1.9.10/functions/__antidote_load_prep000066400000000000000000000036561500640522100215030ustar00rootroot00000000000000#!/bin/zsh ### Prep to load #function __antidote_load_prep { emulate -L zsh; setopt local_options $_adote_funcopts # pass in bundle file, read from zstyle, or use default .zsh_plugins.txt local bundlefile="$1" if [[ -z "$bundlefile" ]]; then zstyle -s ':antidote:bundle' file 'bundlefile' || bundlefile=${ZDOTDIR:-$HOME}/.zsh_plugins.txt fi # pass in static file, read from zstyle, change extension, or use default .zsh_plugins.zsh local staticfile="$2" if [[ -z "$staticfile" ]]; then zstyle -s ':antidote:static' file 'staticfile' if [[ -z "$staticfile" ]]; then if [[ -z "$bundlefile:t:r" ]]; then staticfile=${bundlefile}.zsh else staticfile=${bundlefile:r}.zsh fi fi fi if [[ ! -e "$bundlefile" ]]; then # the files can't have the same name print -ru2 -- "antidote: bundle file not found '$bundlefile'." return 1 elif [[ "$bundlefile" == "$staticfile" ]]; then # the files can't have the same name print -ru2 -- "antidote: bundle file and static file are the same '$bundlefile'." return 1 fi # regenerate the static file based on whether the bundle file is newer and whether # antidote home exists and is ready to be loaded local force_bundle=0 if ! zstyle -t ':antidote:load:checkfile' disabled; then local loadable_check_path="$(antidote-home)/.antidote.load" if [[ ! -e $loadable_check_path ]]; then force_bundle=1 [[ -d $loadable_check_path:h ]] || mkdir -p $loadable_check_path:h touch $loadable_check_path fi fi if [[ ! $staticfile -nt $bundlefile ]] || [[ $force_bundle -eq 1 ]]; then mkdir -p "${staticfile:A:h}" antidote bundle <"$bundlefile" >|"$staticfile" if [[ -r "${staticfile}.zwc" ]] && ! zstyle -t ':antidote:static' zcompile; then __antidote_del -f -- "${staticfile}.zwc" fi fi # tell antidote-load what to source typeset -g REPLY=$staticfile #print $REPLY #} antidote-1.9.10/functions/__antidote_mktemp000066400000000000000000000020441500640522100210210ustar00rootroot00000000000000#!/bin/zsh ### Create a cross-platform temporary directory/file for antidote. # # usage: __antidote_mktemp [-d] [-f suffix] # -d Create a directory rather than a file # -s Use this for the temp file/dir # # Returns the path of created temp directory/file. # #function __antidote_mktemp { emulate -L zsh; setopt local_options $_adote_funcopts local -a o_dir o_suffix zparseopts $_adote_zparopt_flags -- d=o_dir s:=o_suffix # Set the appropriate temp directory (cargo cult code from p10k) local tmpbase if [[ -n "$TMPDIR" && (( -d "$TMPDIR" && -w "$TMPDIR" ) || ! ( -d /tmp && -w /tmp )) ]]; then tmpbase="${TMPDIR%/}" else tmpbase="/tmp" fi # Create the pattern with PID local pattern="antidote.$$" # Add suffix if provided with -s if (( $#o_suffix )) && [[ -n "${o_suffix[-1]}" ]]; then pattern="${pattern}.${o_suffix[-1]}" fi # Add random chars pattern="${pattern}.XXXXXXXXXX" # Create temp directory or file if (( $#o_dir )); then command mktemp -d "${tmpbase}/${pattern}" else command mktemp "${tmpbase}/${pattern}" fi #} antidote-1.9.10/functions/__antidote_parse_bundles000066400000000000000000000033771500640522100223640ustar00rootroot00000000000000#!/bin/zsh ### Parse antidote's bundle DSL. #function __antidote_parse_bundles { emulate -L zsh; setopt local_options $_adote_funcopts # Declare vars local bundle_str bundle_repr collected_input err lineno=0 skip_load_defer=0 local key val local -a bundles local -A bundle # Get piped/passed bundles collected_input="$(__antidote_collect_input "$@")" if [[ -n "$collected_input" ]]; then bundles=( "${(@f)collected_input}" ) else bundles=() fi if ! (( $#bundles )) ; then print -ru2 -- "antidote: error: bundle argument expected" return 1 fi # Loop through bundles for bundle_str in $bundles; do (( lineno += 1 )) # Parse the bundle. bundle_repr=$(__antidote_parser "$bundle_str"); err=$? if [[ -z "$bundle_repr" ]]; then continue elif [[ "$err" -ne 0 ]]; then print -ru2 -- "antidote: Bundle parser error on line ${lineno}: '$bundle_str'" return 1 fi # Turn the typeset repr into the bundle assoc_arr eval "$bundle_repr" # move flags to front and call antidote-script print -rn -- "antidote-script" for key in ${(ok)bundle}; do [[ "$key" != name ]] && [[ "$key" != '_'* ]] || continue val="${bundle[$key]}" if [[ "$val" == "${(q)val}" ]]; then printf ' --%s %s' $key $val else printf ' --%s %s' $key ${(qqq)val} fi done # Add flag for first defer if [[ "${bundle[kind]}" == "defer" ]]; then if [[ "$skip_load_defer" -eq 0 ]]; then skip_load_defer=1 else printf ' --skip-load-defer' fi fi # Escape leading '$' variables if [[ "${bundle[name]}" == '$'* ]]; then printf ' \$%s\n' "${bundle[name]#\$}" else printf ' %s\n' "${bundle[name]}" fi done #} antidote-1.9.10/functions/__antidote_parser000066400000000000000000000101551500640522100210220ustar00rootroot00000000000000#!/bin/zsh ### Parse antidote's bundle DSL to an associative array. # Example: # __antidote_parser 'foo/bar path:plugins/baz kind:fpath pre:myprecmd # comment' # typeset -A bundle=( [kind]=fpath [path]=plugins/baz [pre]=myprecmd [name]=foo/bar ) # # Notes: # bundle_str : antidote DSL syntax # bundle : assoc array representation # bundle_repr : Zsh serialization of the bundle assoc arrary # # Metadata: # _repodir : The clone destination dir # _type : The type of bundle (url, repo, path, ?) # _repo : The user/repo short form of the URL # _url : The git repo URL # #function __antidote_parser { emulate -L zsh; setopt local_options $_adote_funcopts local MATCH MBEGIN MEND; local -a match mbegin mend # appease 'warn_create_global' local bundle_str bundle_var bundle_repr gitsite str pair key value local -a kvpairs parts local -A bundle bundle_str="$1" bundle_var="${2:-bundle}" # Allow the user to override the default git site if they really want to zstyle -s ':antidote:gitremote' url 'gitsite' \ || gitsite='https://github.com' gitsite="${gitsite%/}" # Remove anything after the first '#' bundle_str=${bundle_str%%\#*} # Trim spaces bundle_str=${${bundle_str/#[[:space:]]#}/%[[:space:]]#} # Skip empty bundle strings [[ -z "$bundle_str" ]] && return 0 # 1st field gets a 'name:' prefix so we can treat everything as key:val pairs bundle_str="name:${bundle_str}" # Split line into key-value pairs with quoting kvpairs=(${(Q)${(z)bundle_str}}) for pair in "${kvpairs[@]}"; do key=${pair%%:*} # Extract key (before first ':') if [[ "$pair" == *:* ]]; then value=${pair#*:} # Extract value (after first ':') else value= fi bundle[$key]=$value done # Enhance the bundle with metadata fields. Metadata fields begin with an underscore # since those will never be part of the DSL. Let's start with _type, which tells us # whether the bundle is a URL, a user/repo, or a path if [[ "$bundle[name]" == *://*/*/* || "$bundle[name]" == (ssh|git)@*:*/* ]]; then if [[ "$bundle[name]" == *://*/*/*/* || "$bundle[name]" == *@*:*/*/* ]]; then bundle[_type]="?" else bundle[_type]="url" fi elif [[ "$bundle[name]" == *('@'|':')* ]] ; then bundle[_type]="?" # bad URLs elif [[ "$bundle[name]" == ('~'|'$'|'.')* ]]; then bundle[_type]="path" elif [[ "$bundle[name]" == */* && "$bundle[name]" != */*/* ]]; then bundle[_type]="repo" elif [[ "$bundle[name]" == */* ]]; then bundle[_type]="path" else bundle[_type]="?" fi # For git repos, we add a metadata field for the URL if [[ "$bundle[_type]" == url ]]; then str="$bundle[name]" str=${str%.git} str=${str:gs/\:/\/} parts=( ${(ps./.)str} ) if [[ $#parts -gt 1 ]]; then bundle[_repo]="${parts[-2]}/${parts[-1]}" else bundle[_repo]="$str" fi bundle[_url]="$bundle[name]" elif [[ "$bundle[_type]" == repo ]]; then bundle[_repo]="${bundle[name]}" bundle[_url]="${gitsite}/${bundle[name]}" fi # If there's a git URL, we also need to set the _repodir if [[ -v bundle[_url] ]]; then # TODO: Remove for antidote 2.0 if zstyle -t ':antidote:compatibility-mode' 'antibody' || ! zstyle -t ':antidote:bundle' use-friendly-names; then # sanitize URL for safe use as a dir name # ex: $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions str="$bundle[_url]" str=${str%.git} str=${str:gs/\@/-AT-} str=${str:gs/\:/-COLON-} str=${str:gs/\//-SLASH-} bundle[_repodir]="$str" else bundle[_repodir]="$bundle[_repo]" fi fi # Print the parsed bundle assoc arr using whatever bundle_var the user wants bundle_repr="$(declare -p bundle)" bundle_repr="typeset -A ${bundle_var}=${bundle_repr#*=}" # Sanity check that I probably don't need. if [[ ! "$bundle_repr" =~ "^typeset\ -A\ ${bundle_var}=" ]]; then print -ru2 -- "antidote: Unable to parse bundle string: '$bundle_str'." return 1 fi # Return/print the result. typeset -g REPLY="$bundle_repr" print -r -- "$REPLY" #} antidote-1.9.10/functions/__antidote_print_path000066400000000000000000000005331500640522100216750ustar00rootroot00000000000000#!/bin/zsh ### Pretty print a path #function __antidote_print_path { emulate -L zsh; setopt local_options $_adote_funcopts local MATCH MBEGIN MEND; local -a match mbegin mend # appease 'warn_create_global' if zstyle -t ':antidote:compatibility-mode' 'antibody'; then print -r -- "$1" else print -r -- "${1/#$HOME/\$HOME}" fi #} antidote-1.9.10/functions/__antidote_setup000066400000000000000000000024611500640522100206670ustar00rootroot00000000000000#!/bin/zsh ### Setup antidote. #function __antidote_setup { 0=${(%):-%x} fpath=( "${0:A:h}" $fpath ) local fn for fn in ${0:A:h}/*; do [[ ${fn:t} != '__antidote_setup' ]] || continue if typeset -f ${fn:t} > /dev/null; then unfunction -- ${fn:t} fi # autoload extensionless function files [[ -z "${fn:e}" ]] && autoload -Uz "${fn}" done # man pages if [[ "$MANPATH" != *"${0:A:h:h}/man"* ]]; then export MANPATH="${0:A:h:h}/man:$MANPATH" fi builtin autoload -Uz is-at-least if is-at-least 5.8; then # -D : Delete flags from the param array once they are detected # -M : Map a flag to alternative names (useful for defining -s(hort) and --long options) # -F : Fail if a flad is provided that was not defined in the zparseops spec # the -F option was added in 5.8 typeset -gHa _adote_zparopt_flags=( -D -M -F ) else typeset -gHa _adote_zparopt_flags=( -D -M ) fi typeset -gHa _adote_funcopts=( extended_glob no_monitor pipefail ) if zstyle -t ':antidote:tests' set-warn-options; then typeset -gHa _adote_funcopts=( $_adote_funcopts warn_create_global warn_nested_var ) fi gawk --version &>/dev/null && typeset -gH __adote_awkcmd=gawk || typeset -gH __adote_awkcmd=awk typeset -gHi __adote_ksh_arrays typeset -gHi __adote_sh_glob #} antidote-1.9.10/functions/__antidote_tourl000066400000000000000000000004361500640522100206740ustar00rootroot00000000000000#!/bin/zsh ### Get the url from a repo bundle. #function __antidote_tourl { emulate -L zsh; setopt local_options $_adote_funcopts local bundle=$1 local url=$bundle if [[ $bundle != *://* && $bundle != git@*:*/* ]]; then url=https://github.com/$bundle fi print $url #} antidote-1.9.10/functions/__antidote_usage000066400000000000000000000015111500640522100206260ustar00rootroot00000000000000#!/bin/zsh ### Print usage. #function __antidote_usage { emulate -L zsh; setopt local_options $_adote_funcopts cat<] [ ...] 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 EOS #} antidote-1.9.10/functions/__antidote_version000066400000000000000000000004761500640522100212200ustar00rootroot00000000000000#!/bin/zsh ### Get the antidote version. #function __antidote_version { emulate -L zsh; setopt local_options $_adote_funcopts 0=${(%):-%x} local ver='1.9.10' local gitsha=$(git -C "${0:A:h:h}" rev-parse --short HEAD 2>/dev/null) [[ -z "$gitsha" ]] || ver="$ver ($gitsha)" print "antidote version $ver" #} antidote-1.9.10/functions/_antidote000066400000000000000000000071711500640522100173130ustar00rootroot00000000000000#compdef antidote function _antidote_subcommands { local usage=$( antidote --help | ${__adote_awkcmd:-awk} ' BEGIN{OFS=":"; p=0} /^commands:$/ {p=1; next} !p{next} { for(i=3; i<=NF; i++) { $2=$2" "$i } } { print $1,$2 } ' ) local -a subcommands=("${(@f)usage}") _describe -t subcommands 'subcommand' subcommands "$@" } function _antidote_installed_bundles { local -a bundles=("${(@f)$(antidote list -s)}") _describe 'installed bundles' bundles } function _antidote_bundle_kinds { local -a kinds=( 'autoload' 'clone' 'defer' 'fpath' 'path' 'zsh' ) _describe 'bundle kinds' kinds } function _antidote { typeset -A opt_args local context state line local curcontext="$curcontext" local ret=1 _arguments -C \ '(- *)'{-v,--version}'[Show version]' \ '(- *)'{-h,--help}'[Show usage information]' \ '1: :_antidote_subcommands' \ '*:: :->subcmds' && return 0 case "$state" in (subcmds) case $words[1] in (bundle) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ && ret=0 ;; (help) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ && ret=0 ;; (home) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ && ret=0 ;; (init) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ && ret=0 ;; (install|script) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ '(-k --kind)'{-k,--kind}'[The kind of bundle]:kinds:_antidote_bundle_kinds' \ '(-p --path)'{-p,--path}'[A relative subpath within the bundle where the plugin is located]' \ '(-a --autoload)'{-a,--autoload}'[A relative subpath within the bundle where autoload function files are located]' \ '(-c --conditional)'{-c,--conditional}'[A conditional function used to check whether to load the bundle]' \ '(-b --branch)'{-b,--branch}'[The git branch to use]' \ '(--pre)--pre[A function to be called prior to loading the bundle]' \ '(--post)--post[A function to be called after loading the bundle]' \ && ret=0 ;; (list) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ '(-s --short)'{-s,--short}'[Show shortened repos where possible]' \ '(-d --dirs)'{-d,--dirs}'[Show only bundle directories]' \ '(-u --url)'{-u,--url}'[Show bundle URLs]' \ && ret=0 ;; (load) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ && ret=0 ;; (path) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ && ret=0 ;; (purge) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ '(-a --all)'{-a,--all}'[Purge all cloned bundles]' \ "*::antidote bundles:_antidote_installed_bundles" \ && ret=0 ;; (update) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ '(-s --selp)'{-s,--self}'[Update antidote]' \ '(-b --bundles)'{-b,--bundles}'[Update bundles]' \ && ret=0 ;; (*) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ '*: :_files' \ && ret=0 ;; esac ;; esac return ret } _antidote "$@" # vim: ft=zsh sw=2 ts=2 et antidote-1.9.10/functions/antidote000066400000000000000000000005111500640522100171430ustar00rootroot00000000000000#!/bin/zsh ### antidote - the cure to slow zsh plugin management # # https://antidote.sh # run `antidote -h` for usage # # Note: this gets overridden if using `antidote init`. # #function antidote { 0=${(%):-%x} if ! typeset -f antidote-main > /dev/null; then source ${0:A:h:h}/antidote.zsh fi antidote-main "$@" #} antidote-1.9.10/functions/antidote-bundle000066400000000000000000000025511500640522100204200ustar00rootroot00000000000000#!/bin/zsh ### Clone bundle(s) and generate the static load script. # # usage: antidote bundle [-h|--help] ... # ### Clone bundle(s) and generate the static load script. #function antidote-bundle { # Download a bundle and prints its Zsh source line. emulate -L zsh; setopt local_options $_adote_funcopts local o_help zparseopts $_adote_zparopt_flags -- h=o_help -help=h || return 1 if (( $#o_help )); then antidote-help bundle return fi # handle bundles as newline delimited arg strings, # or as 1 )); then source <(printf '%s\n' $bundles | __antidote_bulk_clone) fi # generate bundle script source <(printf '%s\n' $bundles | __antidote_parse_bundles) #} antidote-1.9.10/functions/antidote-help000066400000000000000000000011751500640522100201000ustar00rootroot00000000000000#!/bin/zsh ### Show antidote documentation. # # usage: antidote [-h|--help] [] # antidote help [] # #function antidote-help { emulate -L zsh; setopt local_options $_adote_funcopts local o_help zparseopts $_adote_zparopt_flags -- h=o_help -help=h || return 1 local manpage if (( $#o_help )); then manpage=antidote-help elif [[ "$1" == antidote ]]; then manpage=antidote elif [[ -n "$1" ]]; then manpage="antidote-${1}" fi if (( $+commands[man] )) && [[ -n "$manpage" ]]; then man "$manpage" || { __antidote_usage && return 1 } else __antidote_usage fi #} antidote-1.9.10/functions/antidote-home000066400000000000000000000011101500640522100200650ustar00rootroot00000000000000#!/bin/zsh ### Print where antidote is cloning bundles. # # usage: antidote home [-h|--help] # # Can be overridden by setting `$ANTIDOTE_HOME`. # #function antidote-home { emulate -L zsh; setopt local_options $_adote_funcopts typeset -g REPLY= local o_help zparseopts $_adote_zparopt_flags -- h=o_help -help=h || return 1 if (( $#o_help )); then antidote-help home return fi local result if [[ -n "$ANTIDOTE_HOME" ]]; then result=$ANTIDOTE_HOME else result=$(__antidote_get_cachedir "antidote") fi print $result typeset -g REPLY=$result #} antidote-1.9.10/functions/antidote-init000066400000000000000000000013571500640522100201150ustar00rootroot00000000000000#!/bin/zsh ### Initialize the shell for dynamic bundles. # # usage: antidote init [-h|--help] # source <(antidote init) # # This function changes how the `antidote` command works by sourcing the results of # `antidote bundle` instead of just generating the Zsh script. #function antidote-init { local o_help zparseopts $_adote_zparopt_flags -- h=o_help -help=h || return 1 if (( $#o_help )); then antidote-help init return fi local script=( '#!/usr/bin/env zsh' 'function antidote {' ' case "$1" in' ' bundle)' ' source <( antidote-main $@ ) || antidote-main $@' ' ;;' ' *)' ' antidote-main $@' ' ;;' ' esac' '}' ) printf "%s\n" "${script[@]}" #} antidote-1.9.10/functions/antidote-install000066400000000000000000000033641500640522100206200ustar00rootroot00000000000000#!/bin/zsh ### Clone a new bundle and add it to your plugins file. # usage: antidote install [-h|--help] [-k|--kind ] [-p|--path ] # [-c|--conditional ] [-b|--branch ] # [--pre ] [--post ] # [-a|--autoload ] [] #function antidote-install { emulate -L zsh; setopt local_options $_adote_funcopts local -A flag_to_annotation=( '-a' autoload '-b' branch '-c' conditional '-h' help '-k' kind '-p' path ) local -a annotations=() local arg while (( $# )); do arg="$1" case "$arg" in -h|--help) antidote-help install return ;; --) shift; break ;; --*) annotations+=( "${arg#*--}:$2" ); shift ;; -*) annotations+=( $flag_to_annotation[$arg]:$2 ); shift ;; *) break ;; esac shift done if [[ $# -eq 0 ]]; then print -ru2 "antidote: error: required argument 'bundle' not provided, try --help" return 1 fi local bundle=$1 local bundlefile=$2 if [[ -z "$bundlefile" ]]; then zstyle -s ':antidote:bundle' file 'bundlefile' || bundlefile=${ZDOTDIR:-$HOME}/.zsh_plugins.txt fi local bundledir=$(__antidote_bundle_dir $bundle) if [[ -d "$bundledir" ]]; then print -ru2 "antidote: error: $bundle already installed: $bundledir" return 1 fi # use antidote bundle to clone our bundle local bundlestr=$bundle (( $#annotations )) && bundlestr+=" $annotations" antidote-bundle "$bundlestr" >/dev/null if [[ $? -ne 0 ]]; then print -ru2 "antidote: unable to install bundle '$bundle'." else print "Adding bundle to '$bundlefile':" print $bundlestr | tee -a $bundlefile fi #} antidote-1.9.10/functions/antidote-list000066400000000000000000000021261500640522100201200ustar00rootroot00000000000000#!/bin/zsh ### List cloned bundles. # # usage: antidote list [-h|--help] [-s|--short] [-d|--dirs] [-u|--url] # #function antidote-list { emulate -L zsh; setopt local_options $_adote_funcopts local o_help o_short o_url o_dirs zparseopts $_adote_zparopt_flags -- \ h=o_help -help=h \ s=o_short -short=s \ u=o_url -url=u \ d=o_dirs -dirs=d || return 1 if (( $#o_help )); then antidote-help list return fi if [[ $# -ne 0 ]]; then print -ru2 "antidote: error: unexpected $1, try --help" return 1 fi local bundledir local output=() local bundles=($(antidote-home)/**/.git(/N)) for bundledir in $bundles; do bundledir=${bundledir:h} local url=$(git -C "$bundledir" config remote.origin.url) if (( $#o_dirs )); then output+=($bundledir) elif (( $#o_url )); then output+=($url) elif (( $#o_short )); then url=${url%.git} url=${url#https://github.com/} output+=($url) else output+=("$(printf '%-64s %s\n' $url $bundledir)") fi done (( $#output )) && printf '%s\n' ${(o)output} #} antidote-1.9.10/functions/antidote-load000066400000000000000000000015131500640522100200630ustar00rootroot00000000000000#!/bin/zsh ### Statically source all bundles from the plugins file. # # usage: antidote load [-h|--help] [ []] # #function antidote-load { if [[ "$1" == (-h|--help) ]]; then antidote-help load return fi # We can't use LOCAL_OPTIONS because sourcing plugins means we'd lose any Zsh options # set in those plugins, so we delegate all the work to __antidote_load_prep where # we can safely use LOCAL_OPTIONS. For this function, we should do the bare minimum # so the user can set whatever crazy Zsh options they want, and antidote doesn't need # to concern itself with that. # # "Is your house on fire, Clark? No, Aunt Bethany, those are the user's Zsh options." # typeset -g REPLY= __antidote_load_prep "$@" || return 1 [[ -f "$REPLY" ]] || return 2 source "$REPLY" unset REPLY #} antidote-1.9.10/functions/antidote-main000066400000000000000000000023531500640522100200730ustar00rootroot00000000000000#!/bin/zsh ### The main controller for antidote. # The reason we use `antidote-main` instead putting all of this in `antidote` # is that this allows the `antidote` function to be overridden via `antidote init`. # The init command switches antidote from static mode to dynamic mode, but this # core functionality remains. #function antidote-main { 0=${(%):-%x} [[ -o KSH_ARRAYS ]] && __adote_ksh_arrays=1 && unsetopt KSH_ARRAYS [[ -o SH_GLOB ]] && __adote_sh_glob=1 && unsetopt SH_GLOB local o_help o_version zparseopts ${_adote_zparopt_flags} -- \ h=o_help -help=h \ v=o_version -version=v || return 1 local ret=0 if (( ${#o_version} )); then __antidote_version elif (( ${#o_help} )); then antidote-help "$@" elif [[ ${#} -eq 0 ]]; then antidote-help ret=2 elif [[ "${1}" = help ]]; then local manpage=${2:-antidote} antidote-help $manpage elif (( $+functions[antidote-${1}] )); then local cmd=${1}; shift antidote-${cmd} "$@" ret=$? else print -ru2 "antidote: command not found '${1}'" ret=1 fi (( __adote_ksh_arrays )) && __adote_ksh_arrays=0 && setopt KSH_ARRAYS (( __adote_sh_glob )) && __adote_sh_glob=0 && setopt SH_GLOB return $ret #} antidote-1.9.10/functions/antidote-path000066400000000000000000000017331500640522100201040ustar00rootroot00000000000000#!/bin/zsh ### Print the path of a cloned bundle. # # usage: antidote path [-h|--help] # #function antidote-path { emulate -L zsh; setopt local_options $_adote_funcopts local o_help zparseopts $_adote_zparopt_flags -- h=o_help -help=h || return 1 if (( $#o_help )); then antidote-help path return fi local -a bundles=("${(@f)$(__antidote_collect_input "$@")}") if (( $#bundles == 0 )); then print -ru2 "antidote: error: required argument 'bundle' not provided, try --help" return 1 fi local bundle bundledir local -a results=() for bundle in $bundles; do if [[ $bundle == '$'* ]] && [[ $bundle != *'('* ]] && [[ $bundle != *';'* ]]; then bundle=$(eval print $bundle) fi bundledir=$(__antidote_bundle_dir $bundle) if [[ ! -d $bundledir ]]; then print -ru2 "antidote: error: $bundle does not exist in cloned paths" return 1 else results+=("$bundledir") fi done print -l -- $results #} antidote-1.9.10/functions/antidote-purge000066400000000000000000000051331500640522100202700ustar00rootroot00000000000000#!/bin/zsh ### Remove a cloned bundle. # # usage: antidote purge [-h|--help] # antidote purge [-a|--all] # #function antidote-purge { emulate -L zsh; setopt local_options $_adote_funcopts local o_help o_all zparseopts $_adote_zparopt_flags -- \ h=o_help -help=h \ a=o_all -all=a || return 1 if (( $#o_help )); then antidote-help purge return fi if [[ $# -eq 0 ]] && ! (( $#o_all )); then print -ru2 "antidote: error: required argument 'bundle' not provided, try --help" return 1 fi local bundlefile zstyle -s ':antidote:bundle' file 'bundlefile' || bundlefile=${ZDOTDIR:-$HOME}/.zsh_plugins.txt if (( $#o_all )); then # last chance to save the user from themselves local antidote_home="$(antidote-home)" local REPLY zstyle -s ':antidote:purge:all' answer 'REPLY' || { read -q "REPLY?You are about to permanently remove '$antidote_home' and all its contents!"$'\n'"Are you sure [Y/n]? " print } [[ ${REPLY:u} == "Y" ]] || return 1 # remove antidote home and static cache file __antidote_del -rf -- "$antidote_home" if [[ -e "${bundlefile:r}.zsh" ]]; then zstyle -s ':antidote:purge:all' answer 'REPLY' || { read -q "REPLY?You are about to remove '${bundlefile:t:r}.zsh'"$'\n'"Are you sure [Y/n]? " print } if [[ ${REPLY:u} == "Y" ]]; then local dtstmp=$(date -u '+%Y%m%d_%H%M%S') command mv -f "${bundlefile:r}.zsh" "${bundlefile:r}.${dtstmp}.bak" print "'"${bundlefile:r}.zsh"' backed up to '${bundlefile:t:r}.${dtstmp}.bak'" fi fi print "Antidote purge complete. Be sure to start a new Zsh session." else local bundle=$1 # make sure the user isn't trying to do something out-of-bounds if [[ -e "$bundle" ]]; then print -ru2 "antidote: error: '$bundle' is not a repo and cannot be removed by antidote." return 2 fi local bundledir=$(__antidote_bundle_dir $bundle) if [[ ! -d "$bundledir" ]]; then print -ru2 "antidote: error: $bundle does not exist at the expected location: $bundledir" return 1 fi # remove __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 cat "$tmpfile" > "$bundlefile" __antidote_del -f "$tmpfile" print "Bundle '$bundle' was commented out in '$bundlefile'." fi fi #} antidote-1.9.10/functions/antidote-script000066400000000000000000000160271500640522100204560ustar00rootroot00000000000000#!/bin/zsh ### Generate the Zsh script to load a plugin. # # usage: antidote script [-h|--help] [-k|--kind ] [-p|--path ] # [-c|--conditional ] [-b|--branch ] # [--pre ] [--post ] [--skip-load-defer] # [-a|--autoload ] # : zsh,path,fpath,defer,clone,autoload # : Relative path from the bundle root # : The git branch # : A bundle can be a directory, a zsh script, or a git repo # ### Generate the Zsh script to load a plugin. #function antidote-script { emulate -L zsh; setopt local_options $_adote_funcopts local MATCH MBEGIN MEND; local -a match mbegin mend # appease 'warn_create_global' local REPLY= local -a o_help o_kind o_path o_branch o_cond o_autoload o_pre o_post o_fpath_rule o_skip_load_defer zparseopts $_adote_zparopt_flags -- \ h=o_help -help=h \ a:=o_autoload -autoload:=a \ b:=o_branch -branch:=b \ k:=o_kind -kind:=k \ p:=o_path -path:=p \ -pre:=o_pre \ -post:=o_post \ -fpath-rule:=o_fpath_rule \ -skip-load-defer=o_skip_load_defer \ c:=o_cond -conditional:=c || return 1 # set defaults (( $#o_kind )) || o_kind=(--kind zsh) if ! (( $#o_fpath_rule )); then zstyle -a ':antidote:fpath' rule 'o_fpath_rule' || o_fpath_rule=(append) fi # strip '=' or ':' from beginning of arg values local re='^[=:]?(.+)$' [[ $o_kind[-1] =~ $re ]] && o_kind[-1]=$match [[ $o_autoload[-1] =~ $re ]] && o_autoload[-1]=$match [[ $o_path[-1] =~ $re ]] && o_path[-1]=$match [[ $o_cond[-1] =~ $re ]] && o_cond[-1]=$match [[ $o_branch[-1] =~ $re ]] && o_branch[-1]=$match [[ $o_pre[-1] =~ $re ]] && o_pre[-1]=$match [[ $o_post[-1] =~ $re ]] && o_post[-1]=$match [[ $o_fpath_rule[-1] =~ $re ]] && o_fpath_rule[-1]=$match local supported_kind_vals=(autoload clone defer fpath path zsh) if (( $#o_kind )) && ! (( $supported_kind_vals[(Ie)$o_kind[-1]] )); then 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 fi local bundle=$1 if [[ -z "$bundle" ]]; then print -ru2 "antidote: error: bundle argument expected" && return 1 fi local bundle_name=$(__antidote_bundle_name $bundle) # replace ~/ with $HOME/ if [[ "$bundle" == '~/'* ]]; then bundle=$HOME/${bundle#'~/'*} fi # set the path to the bundle (repo or local) local bundle_path [[ -e "$bundle" ]] && bundle_path=$bundle || bundle_path=$(__antidote_bundle_dir $bundle) # handle cloning repo bundles local bundle_type bundle_type="$(__antidote_bundle_type $bundle)" if [[ "$bundle_type" == (repo|url|sshurl) ]] && [[ ! -e "$bundle_path" ]]; then local giturl=$(__antidote_tourl $bundle) print -ru2 "# antidote cloning $bundle_name..." git clone --quiet --recurse-submodules --shallow-submodules $o_branch $giturl $bundle_path [[ $? -eq 0 ]] || return 1 fi # if we only needed to clone the bundle, compile and we're done if [[ "$o_kind[-1]" == "clone" ]]; then if zstyle -t ":antidote:bundle:$bundle" zcompile; then __antidote_bundle_zcompile $bundle_path fi return fi # add path to bundle [[ -n "$o_path[-1]" ]] && bundle_path+="/$o_path[-1]" # handle defer pre-reqs first local dopts zsh_defer='zsh-defer' zstyle -s ":antidote:bundle:${bundle}" defer-options 'dopts' [[ -n "$dopts" ]] && zsh_defer="zsh-defer $dopts" # generate the script local -a script=() # add pre-load function (( $#o_pre )) && script+=("$o_pre[-1]") # 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" if ! (( $#o_skip_load_defer )); then script+=( 'if ! (( $+functions[zsh-defer] )); then' "$(antidote-script $zsh_defer_bundle | __antidote_indent)" 'fi' ) fi fi # Let's make the path a little nicer to deal with local print_bundle_path="$(__antidote_print_path "$bundle_path")" # handle autoloading before sourcing if (( $#o_autoload )); then if [[ "$o_fpath_rule[-1]" == prepend ]]; then script+=("fpath=( \"${print_bundle_path}/${o_autoload[-1]}\" \$fpath )") script+=("builtin autoload -Uz \$fpath[1]/*(N.:t)") else script+=("fpath+=( \"${print_bundle_path}/${o_autoload[-1]}\" )") script+=("builtin autoload -Uz \$fpath[-1]/*(N.:t)") fi fi # generate load script bundle_type="$(__antidote_bundle_type $bundle_path)" local fpath_script if [[ "$o_fpath_rule[-1]" == prepend ]]; then fpath_script="fpath=( \"$print_bundle_path\" \$fpath )" else fpath_script="fpath+=( \"$print_bundle_path\" )" fi if [[ "$o_kind[-1]" == fpath ]]; then # fpath script+="$fpath_script" elif [[ "$o_kind[-1]" == path ]]; then # path script+="export PATH=\"$print_bundle_path:\$PATH\"" elif [[ "$o_kind[-1]" == autoload ]]; then # autoload script+=("$fpath_script") if [[ "$o_fpath_rule[-1]" == prepend ]]; then script+=("builtin autoload -Uz \$fpath[1]/*(N.:t)") else script+=("builtin autoload -Uz \$fpath[-1]/*(N.:t)") fi else if zstyle -t ":antidote:bundle:$bundle" zcompile; then __antidote_bundle_zcompile $bundle_path fi if [[ $bundle_type == file ]]; then script+="$source_cmd \"$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 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 print_initfile="$(__antidote_print_path "$initfile")" script+="$source_cmd \"$print_initfile\"" done fi fi # add post-load function if (( $#o_post )); then if [[ "$o_kind[-1]" == "defer" ]]; then script+=("${zsh_defer} $o_post[-1]") else script+=("$o_post[-1]") fi fi # mark bundle as loaded # script+="zstyle ':antidote:bundle:${bundle_name}' loaded yes" # wrap conditional if [[ -n "$o_cond[-1]" ]]; then print "if $o_cond[-1]; then" printf " %s\n" $script print "fi" else printf "%s\n" $script fi #} antidote-1.9.10/functions/antidote-update000066400000000000000000000116571500640522100204400ustar00rootroot00000000000000#!/bin/zsh ### Update antidote and its cloned bundles. # # usage: antidote update [-h|--help] # #function antidote-update { 0=${(%):-%x} emulate -L zsh; setopt local_options $_adote_funcopts local o_help o_self o_bundles zparseopts $_adote_zparopt_flags -- \ h=o_help -help=h \ s=o_self -self=s \ b=o_bundles -bundles=b || return 1 if (( $#o_help )); then antidote-help update return fi # colors local green blue normal if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then if (( $+commands[tput] )); then green=$(tput setaf 2) blue=$(tput setaf 4) normal=$(tput sgr0) else green=$'\E[32m' blue=$'\E[34m' normal=$'\E[0m' fi fi if (( $#o_bundles )) || ! (( $#o_self )); then print "Updating bundles..." local bundledir url repo # remove zcompiled files __antidote_del -rf -- $(antidote-home)/**/*.zwc(N) # remove check file local loadable_check_path="$(antidote-home)/.antidote.load" [[ -r "$loadable_check_path" ]] && __antidote_del -- "$loadable_check_path" # Setup temporary directory and tracking local tmpfile typeset -g __antidote_update_tmpdir=$(__antidote_mktemp -d -s update) local tmpdir=$__antidote_update_tmpdir # Cleanup function to ensure we don't leave temp files behind __antidote_update_cleanup() { [[ -d "$__antidote_update_tmpdir" ]] && __antidote_del -rf -- "$__antidote_update_tmpdir" unset __antidote_update_tmpdir } # Set trap to ensure cleanup on exit, interrupt, etc. # (EXIT is special, 2=INT, 15=TERM, 1=HUP) trap __antidote_update_cleanup EXIT 2 15 1 # update all bundles for bundledir in $(antidote-list --dirs); do url=$(git -C "$bundledir" config remote.origin.url) repo="${url:h:t}/${${url:t}%.git}" print "antidote: checking for updates: $url" () { # Create a temporary output file in our temp directory local repo_id="${repo//\//-SLASH-}" local tmpfile="${tmpdir}/${repo_id}.output" local oldsha=$(git -C "$1" rev-parse --short HEAD) # Set environment variables to isolate git from user config local GIT_CONFIG_GLOBAL=/dev/null local GIT_CONFIG_SYSTEM=/dev/null # Unshallow the repo, because with the SHA locking feature coming in v2, we'll # need to have everything. if git -C "$1" rev-parse --is-shallow-repository 2>/dev/null | grep -q "true" || [[ -f "$1/.git/shallow" ]]; then git -C "$1" fetch --quiet --unshallow else git -C "$1" fetch --quiet fi git -C "$1" pull --quiet --ff --rebase --autostash git -C "$1" submodule --quiet sync --recursive git -C "$1" submodule --quiet update --init --recursive --depth 1 local newsha=$(git -C "$1" rev-parse --short HEAD) # Capture all output to temporary file { if [[ $oldsha != $newsha ]]; then print -- "${green}antidote: updated: $2 ${oldsha} -> ${newsha}${normal}" git -C "$1" --no-pager log --oneline --ancestry-path --first-parent "${oldsha}^..${newsha}" 2>/dev/null fi # recompile bundles if zstyle -t ":antidote:bundle:$repo" zcompile; then __antidote_bundle_zcompile $bundledir fi } > "$tmpfile" 2>&1 } "$bundledir" "$url" & done print "Waiting for bundle updates to complete..." print "" wait # Display all output in sequence for tmpfile in "$tmpdir"/*.output(N); do if [[ -s "$tmpfile" ]]; then # Extract the repo id from the filename and decode it local filename=${tmpfile:t} local repo_id=${filename%.output} repo_id=${repo_id//-SLASH-/\/} print "${blue}Bundle ${repo_id} update check complete.${normal}" # Colorize the SHA ${__adote_awkcmd:-awk} ' BEGIN { YELLOW="\033[33m" NORMAL="\033[0m" } NF >= 1 { printf "%s%s%s %s\n", YELLOW, $1, NORMAL, substr($0, length($1) + 2) next } { print } END { print "" } ' "$tmpfile" fi done # The trap will do this cleanup too, but let's run this ASAP. __antidote_update_cleanup print "${green}Bundle updates complete.${normal}" print "" fi # update antidote if (( $#o_self )) || ! (( $#o_bundles )); then print "Updating antidote..." if [[ -d "${0:A:h:h}/.git" ]]; then git -C "${0:A:h:h}" pull --quiet --ff --rebase --autostash print "antidote self-update complete.\n" # setup antidote again (( $+functions[__antidote_setup] )) && unfunction __antidote_setup builtin autoload -Uz ${0:A:h}/__antidote_setup __antidote_setup # show antidote version antidote -v else print "Self updating is disabled in this build." print "Use your OS package manager to update antidote itself." fi fi #} antidote-1.9.10/makefile000066400000000000000000000020301500640522100150770ustar00rootroot00000000000000# Do not remove ##? comments. They are used by 'help' to construct the help docs. ##? antidote - the cure to slow zsh plugin management ##? ##? Usage: make " ##? ##? Commands: .DEFAULT_GOAL := help all : build buildman test unittest bump-maj bump-min bump-rev help .PHONY : all ##? help display this makefile's help information help: @grep "^##?" makefile | cut -c 5- ##? build run build tasks like generating man pages build: ./tools/buildman ./tools/run-clitests ./tools/bumpver revision ##? buildman rebuild man pages buildman: ./tools/buildman ##? test run tests test: ./tools/run-clitests ##? unittest run only unittests unittest: ./tools/run-clitests --unit ##? bump-maj bump the major version (X.0.0) bump-maj: ./tools/bumpver major ##? bump-min bump the minor version (0.X.0) bump-min: ./tools/bumpver minor ##? bump-rev bump the revision version (0.0.X) bump-rev: ./tools/bumpver revision ##? bumpver bump the revision version (0.0.X) bumpver: ./tools/bumpver revision antidote-1.9.10/man/000077500000000000000000000000001500640522100141575ustar00rootroot00000000000000antidote-1.9.10/man/antidote-bundle.md000066400000000000000000000072171500640522100175660ustar00rootroot00000000000000--- title: antidote-bundle section: 1 header: Antidote Manual --- # NAME **antidote bundle** - download a bundle and print its source line # SYNOPSIS | antidote bundle [\...] # DESCRIPTION **antidote-bundle** assembles your Zsh plugins. Bundles can be git repos, or local files or directories. If a plugin is a repo, it will be cloned if necessary. The zsh code necessary to load (source) the plugin is then printed. | antidote bundle gituser/gitrepo | antidote bundle $ZSH_CUSTOM/plugins/myplugin | antidote bundle ${ZDOTDIR:-\$HOME}/.zlibs/myfile.zsh Bundles also support annotations. Annotations allow you have finer grained control over your plugins. Annotations are used in the form \'keyword:value\'. `kind` : - **zsh**: A zsh plugin. This is the default kind of bundle. : - **fpath**: Only add the plugin to your _\$fpath_. : - **path**: Add the plugin to your _\$PATH_. : - **clone**: Only clone a plugin, but don't do anything else with it. : - **defer**: Defers loading of a plugin using \'romkatv/zsh-defer\'. : - **autoload**: Autoload all the files in the plugin directory as zsh functions. `branch` : The branch annotation allows you to change the default branch of a plugin's repo from **main** to a branch of your choosing. `path` : The path annotation allows you to use a subdirectory or file within a plugin's structure instead of the root plugin (eg: \'path:plugins/subplugin\'). `conditional` : The conditonal annotation allows you to wrap an **if** statement around a plugin's load script. Supply the name of a zero argument zsh function to conditional to perform the test (eg: \'conditional:is-macos\'). `pre` / `post` : The pre and post annotations allow you to call a function before or after a plugin's load script. This is helpful when configuring plugins, since the configuration functions will only run for active plugins. Supply the name of a zero argument zsh function to pre or post. `autoload` : The autoload annotation allows you to autoload a zsh functions directory in addition to however the plugin was loaded as specified by \'kind\'. Supply a relative path to autoload (eg: \'autoload:functions\'). Cloned repo directory names can be overridden with the following **zstyle**: | zstyle \':antidote:bundle\' use-friendly-names \'yes\' # OPTIONS -h, \--help : Show the help documentation. [*\...*] : Zsh plugin bundles # EXAMPLES Using the **kind:** annotation... | # a regular plugin (kind:zsh is implied, so it's unnecessary) | antidote bundle zsh-users/zsh-history-substring-search kind:zsh | # add prompt plugins to $fpath | antidote bundle sindresorhus/pure kind:fpath | # add utility plugins to $PATH | antidote bundle romkatv/zsh-bench kind:path | # clone a repo for use in other ways | antidote bundle mbadolato/iTerm2-Color-Schemes kind:clone | # autoload a functions directory | antidote bundle sorin-ionescu/prezto path:modules/utility/functions kind:autoload | # defer a plugin to speed up load times | antidote bundle olets/zsh-abbr kind:defer Using the **branch:** annotation... | # don't use the main branch, use develop instead | antidote bundle zsh-users/zsh-autosuggestions branch:develop Using the **path:** annotation... | # load oh-my-zsh | antidote bundle ohmyzsh/ohmyzsh path:lib | antidote bundle ohmyzsh/ohmyzsh path:plugins/git Using the **conditional:** annotation... | # define a conditional function prior to loading antidote | function is_macos { | [[ $OSTYPE == darwin* ]] || return 1 | } | | # conditionally load a plugin using the function you made | antidote bundle ohmyzsh/ohmyzsh path:plugins/macos conditional:is_macos antidote-1.9.10/man/antidote-help.md000066400000000000000000000006061500640522100172400ustar00rootroot00000000000000--- title: antidote-help section: 1 header: Antidote Manual --- # NAME **antidote help** - show antidote documentation # SYNOPSIS | antidote help [\] # DESCRIPTION **antidote-help** is used to show context-sensitive help for antidote and its commands. # OPTIONS -h, \--help : Inception-style meta-help recursively. [*\*] : Show help for a specific command. antidote-1.9.10/man/antidote-home.md000066400000000000000000000011031500640522100172310ustar00rootroot00000000000000--- title: antidote-home section: 1 header: Antidote Manual --- # NAME **antidote home** - print where antidote is cloning bundles # SYNOPSIS | antidote home # DESCRIPTION **antidote-home** shows you where antidote stores its cloned repos. It is not the home of the antidote utility itself. | antidote home You can override antidote's default home directory by setting the _\$ANTIDOTE_HOME_ variable in your **.zshrc**. # OPTIONS -h, \--help : Show the help documentation. # EXAMPLES You can clear out all your cloned repos like so: | rm -rfi $(antidote home) antidote-1.9.10/man/antidote-init.md000066400000000000000000000015761500640522100172620ustar00rootroot00000000000000--- title: antidote-init section: 1 header: Antidote Manual --- # NAME **antidote init** - initialize the shell for dynamic bundles # SYNOPSIS | source <(antidote init) # DESCRIPTION **antidote-init** changes how the **antidote** command works by causing **antidote bundle** to automatically source its own output instead of just generating the Zsh script for a static file. This behavior exists mainly to support legacy antigen/antibody usage. Static bundling is highly recommended for the best performance. However, dynamic bundling may be preferable for some scenarios, so you can rely on this functionality remaining a key feature in **antidote** to support users preferring dynamic bundles. Typical usage involves adding this snippet to your **.zshrc** before using **antidote bundle** commands: | source <(antidote init) # OPTIONS -h, \--help : Show the help documentation. antidote-1.9.10/man/antidote-install.md000066400000000000000000000030621500640522100177550ustar00rootroot00000000000000--- title: antidote-install section: 1 header: Antidote Manual --- # NAME **antidote install** - install a bundle # SYNOPSIS | antidote install [-h|\--help] [-k|\--kind \] [-p|\--path \] | [-a|\--autoload \] [-c|\--conditional \] | [\--pre \] [\--post \] | [-b|\--branch \] \ [\] # DESCRIPTION **antidote-install** clones a new bundle and adds it to your plugins file. The default bundle file is **${ZDOTDIR:-\$HOME}/.zsh_plugins.txt**. This can be overridden with the following **zstyle**: | zstyle \':antidote:bundle\' file /path/to/my/bundle_file.txt # OPTIONS -h, \--help : Show the help documentation. -k, \--kind : The kind of bundle. Valid values: autoload, fpath, path, clone, defer, zsh. -p, \--path : A relative subpath within the bundle where the plugin is located. -b, \--branch : The git branch to use. -a, \--autoload : A relative subpath within the bundle where autoload function files are located. -c, \--conditional : A conditional function used to check whether to load the bundle. \--pre : A function to be called prior to loading the bundle. \--post : A function to be called after loading the bundle. \ : Bundle to be installed. [\] : Bundle file to write to if not using the default. Defaults to **${ZDOTDIR:-\$HOME}/.zsh_plugins.txt** or zstyle setting. # EXAMPLES | antidote install zsh-users/zsh-history-substring-search antidote-1.9.10/man/antidote-list.md000066400000000000000000000007241500640522100172640ustar00rootroot00000000000000--- title: antidote-list section: 1 header: Antidote Manual --- # NAME **antidote list** - list cloned bundles # SYNOPSIS | antidote list [-h|\--help] [-s|\--short] [-d|\--dirs] [-u|\--url] # DESCRIPTION **antidote-list** lists the cloned bundles in **antidote home**. # OPTIONS -h, \--help : Show the help documentation. -s, \--short : Show shortened repos where possible. -d, \--dirs : Show only bundle directories. -u, \--url : Show bundle URLs. antidote-1.9.10/man/antidote-load.md000066400000000000000000000017761500640522100172400ustar00rootroot00000000000000--- title: antidote-load section: 1 header: Antidote Manual --- # NAME **antidote load** - statically source bundles # SYNOPSIS | antidote load [\ [\]] # DESCRIPTION **antidote-load** will turn the bundle file into a static load file and then source it. The default bundle file is **${ZDOTDIR:-\$HOME}/.zsh_plugins.txt**. This can be overridden with the following **zstyle**: | zstyle \':antidote:bundle\' file /path/to/my/bundle_file.txt The default static file is **${ZDOTDIR:-\$HOME}/.zsh_plugins.zsh**. This can be overridden with the following **zstyle**: | zstyle \':antidote:static\' file /path/to/my/static_file.zsh # OPTIONS -h, \--help : Show the help documentation. [\] : The plugins file to source if not using the default. Defaults to **${ZDOTDIR:-\$HOME}/.zsh_plugins.txt** or zstyle setting. [\] : The static plugins file to generate if not using the default. Defaults to **${ZDOTDIR:-\$HOME}/.zsh_plugins.zsh** or zstyle setting. antidote-1.9.10/man/antidote-path.md000066400000000000000000000005461500640522100172470ustar00rootroot00000000000000--- title: antidote-path section: 1 header: Antidote Manual --- # NAME **antidote path** - print the path of a cloned bundle # SYNOPSIS | antidote path \ # DESCRIPTION **antidote-path** prints the path of a cloned bundle. # OPTIONS -h, \--help : Show the help documentation. [\] : The bundle whose cloned path will be printed. antidote-1.9.10/man/antidote-purge.md000066400000000000000000000006431500640522100174330ustar00rootroot00000000000000--- title: antidote-purge section: 1 header: Antidote Manual --- # NAME **antidote purge** - remove a bundle # SYNOPSIS | antidote purge \ # DESCRIPTION **antidote-purge** removes a cloned bundle. # OPTIONS -h, \--help : Show the help documentation. -a, \--all : Purge all cloned bundles. \ : Bundle to be purged. # EXAMPLES | antidote purge zsh-users/zsh-history-substring-search antidote-1.9.10/man/antidote-update.md000066400000000000000000000006441500640522100175740ustar00rootroot00000000000000--- title: antidote-update section: 1 header: Antidote Manual --- # NAME **antidote update** - update bundles # SYNOPSIS | antidote update [-h|\--help] [-s|\--self] [-b|\--bundles] # DESCRIPTION **antidote-update** updates antidote and its cloned bundles. # OPTIONS -h, \--help : Show the help documentation. -s, \--self : Update antidote. -b, \--bundles : Update bundles. # EXAMPLES | antidote update antidote-1.9.10/man/antidote.md000066400000000000000000000123331500640522100163120ustar00rootroot00000000000000--- title: antidote section: 1 header: Antidote Manual --- # NAME **antidote** - the cure to slow zsh plugin management # SYNOPSIS | antidote [-v | --version] [-h | --help] \ [\ ...] # DESCRIPTION **antidote** is a Zsh plugin manager made from the ground up thinking about performance. It is fast because it can do things concurrently, and generates an ultra-fast static plugin file that you can easily load from your Zsh config. It is written natively in Zsh, is well tested, and picks up where Antigen and Antibody left off. # OPTIONS -h, \--help : Show context-sensitive help for antidote. -v, \--version : Show currently installed antidote 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 # EXAMPLES ## A Simple Config Create a _.zsh_plugins.txt_ file with a list of the plugins you want: | # ${ZDOTDIR:-\$HOME}/.zsh_plugins.txt | zsh-users/zsh-syntax-highlighting | zsh-users/zsh-history-substring-search | zsh-users/zsh-autosuggestions Now, simply load your newly created static plugins file in your _.zshrc_. | # ${ZDOTDIR:-\$HOME}/.zshrc | source /path/to/antidote/antidote.zsh | antidote load ## A More Advanced Config Your _.zsh_plugins.txt_ file supports annotations. Annotations tell antidote how to do things like load plugins from alternate paths. This lets you use plugins from popular frameworks like Oh-My-Zsh: | # ${ZDOTDIR:-\$HOME}/.zsh_plugins.txt | ohmyzsh/ohmyzsh path:lib | ohmyzsh/ohmyzsh path:plugins/git | ohmyzsh/ohmyzsh path:plugins/magic-enter | etc... ## Dynamic Bundling Users familiar with legacy plugin managers like Antigen might prefer to use dynamic bundling. With dynamic bundling you sacrifice some performance to avoid having separate plugin files. To use dynamic bundling, we need to change how **antidote bundle** handles your plugins. We do this by sourcing the output from **antidote init**. An example config might look like this: | source /path/to/antidote/antidote.zsh | source <(antidote init) | antidote bundle zsh-users/zsh-autosuggestions | antidote bundle ohmyzsh/ohmyzsh path:lib | antidote bundle ohmyzsh/ohmyzsh path:plugins/git Instead of calling **antidote bundle** over and over, you might prefer to load bundles with a HEREDOC. | source /path/to/antidote/antidote.zsh | source <(antidote init) | antidote bundle < # AUTHORS - Copyright (c) 2021-2024 Matt McElheny - antidote contributors: # LICENSE MIT antidote-1.9.10/man/man1/000077500000000000000000000000001500640522100150135ustar00rootroot00000000000000antidote-1.9.10/man/man1/antidote-bundle.1000066400000000000000000000107761500640522100201660ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote\-bundle" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote bundle\f[R] \- download a bundle and print its source line .SH SYNOPSIS .PP antidote bundle [\&...] .SH DESCRIPTION \f[B]antidote\-bundle\f[R] assembles your Zsh plugins. Bundles can be git repos, or local files or directories. If a plugin is a repo, it will be cloned if necessary. The zsh code necessary to load (source) the plugin is then printed. .PP \ \ antidote bundle gituser/gitrepo .PD 0 .P .PD \ \ antidote bundle $ZSH_CUSTOM/plugins/myplugin .PD 0 .P .PD \ \ antidote bundle ${ZDOTDIR:\-$HOME}/.zlibs/myfile.zsh .PP Bundles also support annotations. Annotations allow you have finer grained control over your plugins. Annotations are used in the form \[aq]keyword:value\[aq]. .TP \f[CR]kind\f[R] .IP \[bu] 2 \f[B]zsh\f[R]: A zsh plugin. This is the default kind of bundle. .IP \[bu] 2 \f[B]fpath\f[R]: Only add the plugin to your \f[I]$fpath\f[R]. .IP \[bu] 2 \f[B]path\f[R]: Add the plugin to your \f[I]$PATH\f[R]. .IP \[bu] 2 \f[B]clone\f[R]: Only clone a plugin, but don\[cq]t do anything else with it. .IP \[bu] 2 \f[B]defer\f[R]: Defers loading of a plugin using \[aq]romkatv/zsh\-defer\[aq]. .IP \[bu] 2 \f[B]autoload\f[R]: Autoload all the files in the plugin directory as zsh functions. .TP \f[CR]branch\f[R] The branch annotation allows you to change the default branch of a plugin\[cq]s repo from \f[B]main\f[R] to a branch of your choosing. .TP \f[CR]path\f[R] The path annotation allows you to use a subdirectory or file within a plugin\[cq]s structure instead of the root plugin (eg: \[aq]path:plugins/subplugin\[aq]). .TP \f[CR]conditional\f[R] The conditonal annotation allows you to wrap an \f[B]if\f[R] statement around a plugin\[cq]s load script. Supply the name of a zero argument zsh function to conditional to perform the test (eg: \[aq]conditional:is\-macos\[aq]). .TP \f[CR]pre\f[R] / \f[CR]post\f[R] The pre and post annotations allow you to call a function before or after a plugin\[cq]s load script. This is helpful when configuring plugins, since the configuration functions will only run for active plugins. Supply the name of a zero argument zsh function to pre or post. .TP \f[CR]autoload\f[R] The autoload annotation allows you to autoload a zsh functions directory in addition to however the plugin was loaded as specified by \[aq]kind\[aq]. Supply a relative path to autoload (eg: \[aq]autoload:functions\[aq]). .PP Cloned repo directory names can be overridden with the following \f[B]zstyle\f[R]: .PP \ \ zstyle \[aq]:antidote:bundle\[aq] use\-friendly\-names \[aq]yes\[aq] .SH OPTIONS .TP \-h, \-\-help Show the help documentation. .TP [\f[I]\&...\f[R]] Zsh plugin bundles .SH EXAMPLES Using the \f[B]kind:\f[R] annotation\&... .PP \ \ # a regular plugin (kind:zsh is implied, so it\[cq]s unnecessary) .PD 0 .P .PD \ \ antidote bundle zsh\-users/zsh\-history\-substring\-search kind:zsh .PP \ \ # add prompt plugins to $fpath .PD 0 .P .PD \ \ antidote bundle sindresorhus/pure kind:fpath .PP \ \ # add utility plugins to $PATH .PD 0 .P .PD \ \ antidote bundle romkatv/zsh\-bench kind:path .PP \ \ # clone a repo for use in other ways .PD 0 .P .PD \ \ antidote bundle mbadolato/iTerm2\-Color\-Schemes kind:clone .PP \ \ # autoload a functions directory .PD 0 .P .PD \ \ antidote bundle sorin\-ionescu/prezto path:modules/utility/functions kind:autoload .PP \ \ # defer a plugin to speed up load times .PD 0 .P .PD \ \ antidote bundle olets/zsh\-abbr kind:defer .PP Using the \f[B]branch:\f[R] annotation\&... .PP \ \ # don\[cq]t use the main branch, use develop instead .PD 0 .P .PD \ \ antidote bundle zsh\-users/zsh\-autosuggestions branch:develop .PP Using the \f[B]path:\f[R] annotation\&... .PP \ \ # load oh\-my\-zsh .PD 0 .P .PD \ \ antidote bundle ohmyzsh/ohmyzsh path:lib .PD 0 .P .PD \ \ antidote bundle ohmyzsh/ohmyzsh path:plugins/git .PP Using the \f[B]conditional:\f[R] annotation\&... .PP \ \ # define a conditional function prior to loading antidote .PD 0 .P .PD \ \ function is_macos { .PD 0 .P .PD \ \ \ \ [[ $OSTYPE == darwin* ]] || return 1 .PD 0 .P .PD \ \ } .PD 0 .P .PD .PD 0 .P .PD \ \ # conditionally load a plugin using the function you made .PD 0 .P .PD \ \ antidote bundle ohmyzsh/ohmyzsh path:plugins/macos conditional:is_macos .SH BUGS See GitHub Issues: \c .UR https://github.com/mattmc3/antidote/issues .UE \c .SH AUTHORS .IP \[bu] 2 Copyright (c) 2021\-2024 Matt McElheny .IP \[bu] 2 antidote contributors: \c .UR https://github.com/mattmc3/antidote/graphs/contributors .UE \c .SH LICENSE MIT antidote-1.9.10/man/man1/antidote-help.1000066400000000000000000000013061500640522100176320ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote\-help" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote help\f[R] \- show antidote documentation .SH SYNOPSIS .PP antidote help [] .SH DESCRIPTION \f[B]antidote\-help\f[R] is used to show context\-sensitive help for antidote and its commands. .SH OPTIONS .TP \-h, \-\-help Inception\-style meta\-help recursively. .TP [\f[I]\f[R]] Show help for a specific command. .SH BUGS See GitHub Issues: \c .UR https://github.com/mattmc3/antidote/issues .UE \c .SH AUTHORS .IP \[bu] 2 Copyright (c) 2021\-2024 Matt McElheny .IP \[bu] 2 antidote contributors: \c .UR https://github.com/mattmc3/antidote/graphs/contributors .UE \c .SH LICENSE MIT antidote-1.9.10/man/man1/antidote-home.1000066400000000000000000000016301500640522100176320ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote\-home" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote home\f[R] \- print where antidote is cloning bundles .SH SYNOPSIS .PP antidote home .SH DESCRIPTION \f[B]antidote\-home\f[R] shows you where antidote stores its cloned repos. It is not the home of the antidote utility itself. .PP \ \ antidote home .PP You can override antidote\[cq]s default home directory by setting the \f[I]$ANTIDOTE_HOME\f[R] variable in your \f[B].zshrc\f[R]. .SH OPTIONS .TP \-h, \-\-help Show the help documentation. .SH EXAMPLES You can clear out all your cloned repos like so: .PP \ \ rm \-rfi $(antidote home) .SH BUGS See GitHub Issues: \c .UR https://github.com/mattmc3/antidote/issues .UE \c .SH AUTHORS .IP \[bu] 2 Copyright (c) 2021\-2024 Matt McElheny .IP \[bu] 2 antidote contributors: \c .UR https://github.com/mattmc3/antidote/graphs/contributors .UE \c .SH LICENSE MIT antidote-1.9.10/man/man1/antidote-init.1000066400000000000000000000023361500640522100176510ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote\-init" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote init\f[R] \- initialize the shell for dynamic bundles .SH SYNOPSIS .PP source <(antidote init) .SH DESCRIPTION \f[B]antidote\-init\f[R] changes how the \f[B]antidote\f[R] command works by causing \f[B]antidote bundle\f[R] to automatically source its own output instead of just generating the Zsh script for a static file. .PP This behavior exists mainly to support legacy antigen/antibody usage. Static bundling is highly recommended for the best performance. However, dynamic bundling may be preferable for some scenarios, so you can rely on this functionality remaining a key feature in \f[B]antidote\f[R] to support users preferring dynamic bundles. .PP Typical usage involves adding this snippet to your \f[B].zshrc\f[R] before using \f[B]antidote bundle\f[R] commands: .PP \ source <(antidote init) .SH OPTIONS .TP \-h, \-\-help Show the help documentation. .SH BUGS See GitHub Issues: \c .UR https://github.com/mattmc3/antidote/issues .UE \c .SH AUTHORS .IP \[bu] 2 Copyright (c) 2021\-2024 Matt McElheny .IP \[bu] 2 antidote contributors: \c .UR https://github.com/mattmc3/antidote/graphs/contributors .UE \c .SH LICENSE MIT antidote-1.9.10/man/man1/antidote-install.1000066400000000000000000000036671500640522100203640ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote\-install" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote install\f[R] \- install a bundle .SH SYNOPSIS .PP antidote install [\-h|\-\-help] [\-k|\-\-kind ] [\-p|\-\-path ] .PD 0 .P .PD \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ [\-a|\-\-autoload ] [\-c|\-\-conditional ] .PD 0 .P .PD \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ [\-\-pre ] [\-\-post ] .PD 0 .P .PD \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ [\-b|\-\-branch ] [] .SH DESCRIPTION \f[B]antidote\-install\f[R] clones a new bundle and adds it to your plugins file. .PP The default bundle file is \f[B]${ZDOTDIR:\-$HOME}/.zsh_plugins.txt\f[R]. This can be overridden with the following \f[B]zstyle\f[R]: .PP \ \ zstyle \[aq]:antidote:bundle\[aq] file /path/to/my/bundle_file.txt .SH OPTIONS .TP \-h, \-\-help Show the help documentation. .TP \-k, \-\-kind The kind of bundle. Valid values: autoload, fpath, path, clone, defer, zsh. .TP \-p, \-\-path A relative subpath within the bundle where the plugin is located. .TP \-b, \-\-branch The git branch to use. .TP \-a, \-\-autoload A relative subpath within the bundle where autoload function files are located. .TP \-c, \-\-conditional A conditional function used to check whether to load the bundle. .TP \-\-pre A function to be called prior to loading the bundle. .TP \-\-post A function to be called after loading the bundle. .TP Bundle to be installed. .TP [] Bundle file to write to if not using the default. Defaults to \f[B]${ZDOTDIR:\-$HOME}/.zsh_plugins.txt\f[R] or zstyle setting. .SH EXAMPLES .PP \ \ antidote install zsh\-users/zsh\-history\-substring\-search .SH BUGS See GitHub Issues: \c .UR https://github.com/mattmc3/antidote/issues .UE \c .SH AUTHORS .IP \[bu] 2 Copyright (c) 2021\-2024 Matt McElheny .IP \[bu] 2 antidote contributors: \c .UR https://github.com/mattmc3/antidote/graphs/contributors .UE \c .SH LICENSE MIT antidote-1.9.10/man/man1/antidote-list.1000066400000000000000000000014371500640522100176620ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote\-list" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote list\f[R] \- list cloned bundles .SH SYNOPSIS .PP antidote list [\-h|\-\-help] [\-s|\-\-short] [\-d|\-\-dirs] [\-u|\-\-url] .SH DESCRIPTION \f[B]antidote\-list\f[R] lists the cloned bundles in \f[B]antidote home\f[R]. .SH OPTIONS .TP \-h, \-\-help Show the help documentation. .TP \-s, \-\-short Show shortened repos where possible. .TP \-d, \-\-dirs Show only bundle directories. .TP \-u, \-\-url Show bundle URLs. .SH BUGS See GitHub Issues: \c .UR https://github.com/mattmc3/antidote/issues .UE \c .SH AUTHORS .IP \[bu] 2 Copyright (c) 2021\-2024 Matt McElheny .IP \[bu] 2 antidote contributors: \c .UR https://github.com/mattmc3/antidote/graphs/contributors .UE \c .SH LICENSE MIT antidote-1.9.10/man/man1/antidote-load.1000066400000000000000000000025521500640522100176250ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote\-load" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote load\f[R] \- statically source bundles .SH SYNOPSIS .PP antidote load [ []] .SH DESCRIPTION \f[B]antidote\-load\f[R] will turn the bundle file into a static load file and then source it. .PP The default bundle file is \f[B]${ZDOTDIR:\-$HOME}/.zsh_plugins.txt\f[R]. This can be overridden with the following \f[B]zstyle\f[R]: .PP \ \ zstyle \[aq]:antidote:bundle\[aq] file /path/to/my/bundle_file.txt .PP The default static file is \f[B]${ZDOTDIR:\-$HOME}/.zsh_plugins.zsh\f[R]. This can be overridden with the following \f[B]zstyle\f[R]: .PP \ \ zstyle \[aq]:antidote:static\[aq] file /path/to/my/static_file.zsh .SH OPTIONS .TP \-h, \-\-help Show the help documentation. .TP [] The plugins file to source if not using the default. Defaults to \f[B]${ZDOTDIR:\-$HOME}/.zsh_plugins.txt\f[R] or zstyle setting. .TP [] The static plugins file to generate if not using the default. Defaults to \f[B]${ZDOTDIR:\-$HOME}/.zsh_plugins.zsh\f[R] or zstyle setting. .SH BUGS See GitHub Issues: \c .UR https://github.com/mattmc3/antidote/issues .UE \c .SH AUTHORS .IP \[bu] 2 Copyright (c) 2021\-2024 Matt McElheny .IP \[bu] 2 antidote contributors: \c .UR https://github.com/mattmc3/antidote/graphs/contributors .UE \c .SH LICENSE MIT antidote-1.9.10/man/man1/antidote-path.1000066400000000000000000000012331500640522100176350ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote\-path" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote path\f[R] \- print the path of a cloned bundle .SH SYNOPSIS .PP antidote path .SH DESCRIPTION \f[B]antidote\-path\f[R] prints the path of a cloned bundle. .SH OPTIONS .TP \-h, \-\-help Show the help documentation. .TP [] The bundle whose cloned path will be printed. .SH BUGS See GitHub Issues: \c .UR https://github.com/mattmc3/antidote/issues .UE \c .SH AUTHORS .IP \[bu] 2 Copyright (c) 2021\-2024 Matt McElheny .IP \[bu] 2 antidote contributors: \c .UR https://github.com/mattmc3/antidote/graphs/contributors .UE \c .SH LICENSE MIT antidote-1.9.10/man/man1/antidote-purge.1000066400000000000000000000013411500640522100200230ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote\-purge" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote purge\f[R] \- remove a bundle .SH SYNOPSIS .PP antidote purge .SH DESCRIPTION \f[B]antidote\-purge\f[R] removes a cloned bundle. .SH OPTIONS .TP \-h, \-\-help Show the help documentation. .TP \-a, \-\-all Purge all cloned bundles. .TP Bundle to be purged. .SH EXAMPLES .PP \ \ antidote purge zsh\-users/zsh\-history\-substring\-search .SH BUGS See GitHub Issues: \c .UR https://github.com/mattmc3/antidote/issues .UE \c .SH AUTHORS .IP \[bu] 2 Copyright (c) 2021\-2024 Matt McElheny .IP \[bu] 2 antidote contributors: \c .UR https://github.com/mattmc3/antidote/graphs/contributors .UE \c .SH LICENSE MIT antidote-1.9.10/man/man1/antidote-update.1000066400000000000000000000013501500640522100201630ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote\-update" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote update\f[R] \- update bundles .SH SYNOPSIS .PP antidote update [\-h|\-\-help] [\-s|\-\-self] [\-b|\-\-bundles] .SH DESCRIPTION \f[B]antidote\-update\f[R] updates antidote and its cloned bundles. .SH OPTIONS .TP \-h, \-\-help Show the help documentation. .TP \-s, \-\-self Update antidote. .TP \-b, \-\-bundles Update bundles. .SH EXAMPLES .PP antidote update .SH BUGS See GitHub Issues: \c .UR https://github.com/mattmc3/antidote/issues .UE \c .SH AUTHORS .IP \[bu] 2 Copyright (c) 2021\-2024 Matt McElheny .IP \[bu] 2 antidote contributors: \c .UR https://github.com/mattmc3/antidote/graphs/contributors .UE \c .SH LICENSE MIT antidote-1.9.10/man/man1/antidote.1000066400000000000000000000143161500640522100167110ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote\f[R] \- the cure to slow zsh plugin management .SH SYNOPSIS .PP antidote [\-v | \[en]version] [\-h | \[en]help] [ \&...] .SH DESCRIPTION \f[B]antidote\f[R] is a Zsh plugin manager made from the ground up thinking about performance. .PP It is fast because it can do things concurrently, and generates an ultra\-fast static plugin file that you can easily load from your Zsh config. .PP It is written natively in Zsh, is well tested, and picks up where Antigen and Antibody left off. .SH OPTIONS .TP \-h, \-\-help Show context\-sensitive help for antidote. .TP \-v, \-\-version Show currently installed antidote version. .SH COMMANDS .TP \f[CR]help\f[R] Show documentation .TP \f[CR]load\f[R] Statically source all bundles from the plugins file .TP \f[CR]bundle\f[R] Clone bundle(s) and generate the static load script .TP \f[CR]install\f[R] Clone a new bundle and add it to your plugins file .TP \f[CR]update\f[R] Update antidote and its cloned bundles .TP \f[CR]purge\f[R] Remove a cloned bundle .TP \f[CR]home\f[R] Print where antidote is cloning bundles .TP \f[CR]list\f[R] List cloned bundles .TP \f[CR]path\f[R] Print the path of a cloned bundle .TP \f[CR]init\f[R] Initialize the shell for dynamic bundles .SH EXAMPLES .SS A Simple Config Create a \f[I].zsh_plugins.txt\f[R] file with a list of the plugins you want: .PP \ \ \ # ${ZDOTDIR:\-$HOME}/.zsh_plugins.txt .PD 0 .P .PD \ \ \ zsh\-users/zsh\-syntax\-highlighting .PD 0 .P .PD \ \ \ zsh\-users/zsh\-history\-substring\-search .PD 0 .P .PD \ \ \ zsh\-users/zsh\-autosuggestions .PP Now, simply load your newly created static plugins file in your \f[I].zshrc\f[R]. .PP \ \ \ # ${ZDOTDIR:\-$HOME}/.zshrc .PD 0 .P .PD \ \ \ source /path/to/antidote/antidote.zsh .PD 0 .P .PD \ \ \ antidote load .SS A More Advanced Config Your \f[I].zsh_plugins.txt\f[R] file supports annotations. Annotations tell antidote how to do things like load plugins from alternate paths. This lets you use plugins from popular frameworks like Oh\-My\-Zsh: .PP \ \ \ # ${ZDOTDIR:\-$HOME}/.zsh_plugins.txt .PD 0 .P .PD \ \ \ ohmyzsh/ohmyzsh path:lib .PD 0 .P .PD \ \ \ ohmyzsh/ohmyzsh path:plugins/git .PD 0 .P .PD \ \ \ ohmyzsh/ohmyzsh path:plugins/magic\-enter .PD 0 .P .PD \ \ \ etc\&... .SS Dynamic Bundling Users familiar with legacy plugin managers like Antigen might prefer to use dynamic bundling. With dynamic bundling you sacrifice some performance to avoid having separate plugin files. To use dynamic bundling, we need to change how \f[B]antidote bundle\f[R] handles your plugins. We do this by sourcing the output from \f[B]antidote init\f[R]. .PP An example config might look like this: .PP \ \ \ source /path/to/antidote/antidote.zsh .PD 0 .P .PD \ \ \ source <(antidote init) .PD 0 .P .PD \ \ \ antidote bundle zsh\-users/zsh\-autosuggestions .PD 0 .P .PD \ \ \ antidote bundle ohmyzsh/ohmyzsh path:lib .PD 0 .P .PD \ \ \ antidote bundle ohmyzsh/ohmyzsh path:plugins/git .PP Instead of calling \f[B]antidote bundle\f[R] over and over, you might prefer to load bundles with a HEREDOC. .PP \ \ \ source /path/to/antidote/antidote.zsh .PD 0 .P .PD \ \ \ source <(antidote init) .PD 0 .P .PD \ \ \ antidote bundle <] [ ...] 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 % ``` ## Version The `-v/--version` flag displays the current version: ```zsh % antidote --version antidote version 1.9.10 (abcd123) % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/__init__.zsh000066400000000000000000000003501500640522100170310ustar00rootroot00000000000000#!/bin/zsh () { emulate -L zsh setopt local_options 0=${(%):-%x} local projdir="${0:A:h:h}" local testdir="${projdir}/tests" # setup test functions fpath+=( $testdir/functions ) autoload -Uz $testdir/functions/* } antidote-1.9.10/tests/fakegitsite.com/000077500000000000000000000000001500640522100176225ustar00rootroot00000000000000antidote-1.9.10/tests/fakegitsite.com/fakeuser/000077500000000000000000000000001500640522100214275ustar00rootroot00000000000000antidote-1.9.10/tests/fakegitsite.com/fakeuser/fakerepo/000077500000000000000000000000001500640522100232235ustar00rootroot00000000000000antidote-1.9.10/tests/fakegitsite.com/fakeuser/fakerepo/.mockgit/000077500000000000000000000000001500640522100247365ustar00rootroot00000000000000antidote-1.9.10/tests/fakegitsite.com/fakeuser/fakerepo/.mockgit/config/000077500000000000000000000000001500640522100262035ustar00rootroot00000000000000antidote-1.9.10/tests/fakegitsite.com/fakeuser/fakerepo/.mockgit/config/remote.origin.url000066400000000000000000000000521500640522100315050ustar00rootroot00000000000000https://fakegitsite.com/fakeuser/fakerepo antidote-1.9.10/tests/fakegitsite.com/fakeuser/fakerepo/fakerepo.plugin.zsh000066400000000000000000000001121500640522100270340ustar00rootroot00000000000000echo "sourcing fakeuser/fakerepo..." plugins=($plugins fakeuser/fakerepo) antidote-1.9.10/tests/fakegitsite.com/fakeuser/fakerepo/functions/000077500000000000000000000000001500640522100252335ustar00rootroot00000000000000antidote-1.9.10/tests/fakegitsite.com/fakeuser/fakerepo/functions/_fakerepo000066400000000000000000000000451500640522100271100ustar00rootroot00000000000000#!/bin/zsh echo _fakerepo completion antidote-1.9.10/tests/fakegitsite.com/fakeuser/fakerepo/functions/fakerepo000066400000000000000000000001101500640522100267420ustar00rootroot00000000000000#!/bin/zsh function fakerepo { echo fakerepo function } fakerepo "$@" antidote-1.9.10/tests/functions/000077500000000000000000000000001500640522100165565ustar00rootroot00000000000000antidote-1.9.10/tests/functions/aarr_val000066400000000000000000000011011500640522100202610ustar00rootroot00000000000000#!/bin/zsh #function aar_val() { emulate -L zsh; setopt local_options local MATCH MBEGIN MEND; local -a match mbegin mend # appease 'warn_create_global' local input key val array_name local -A assoc_array # Read from standard input while IFS= read -r input; do if [[ $input =~ '^typeset -A ([a-zA-Z_][a-zA-Z0-9_]*)=\((.*)\)$' ]]; then array_name=${match[1]} eval "assoc_array=( ${match[2]} )" print -- "$assoc_array[$1]" else echo "Error: Input does not match an associative array declaration" >&2 return 1 fi done #} antidote-1.9.10/tests/functions/mockgit000066400000000000000000000050341500640522100201400ustar00rootroot00000000000000#!/bin/zsh #function mockgit { # handle these commands: # - `git -C "$dir" config remote.origin.url` # - `git -C "$dir" pull --quiet --ff --rebase --autostash` # - `git -C "$dir" rev-parse --short HEAD` # - `git clone --quiet --depth 1 --recurse-submodules --shallow-submodules --branch branch $url $dir` # - `git --version` emulate -L zsh; setopt local_options extended_glob local MATCH MBEGIN MEND; local -a match mbegin mend # appease 'warn_create_global' 0=${(%):-%x} local prjdir="${0:A:h:h:h}" local args=("$@[@]") local o_path o_quiet o_ff o_rebase o_autostash o_short local o_depth o_recurse_submodules o_shallow_submodules o_branch local o_init o_recursive zparseopts -D -E -- \ C:=o_path \ -short=o_short \ -quiet=o_quiet \ -ff=o_ff \ -rebase=o_rebase \ -autostash=o_autostash \ -recurse-submodules=o_recurse_submodules \ -shallow-submodules=o_shallow_submodules \ -depth:=o_depth \ -branch:=o_branch \ -init=o_init \ -recursive=o_recursive || return 1 if [[ "$@" = "--version" ]]; then echo "mockgit version 0.0.0" elif [[ "$1" = "clone" ]]; then local giturl="$2" local repo="${giturl:h:t}/${${giturl:t}%.git}" local bundledir="${3:-.}" local gitsite_repodir="$prjdir/tests/fakegitsite.com/${repo}" if [[ -d "$gitsite_repodir" ]]; then [[ -d "${bundledir:A}" ]] || mkdir -p "${bundledir:A}" cp -r -- "$gitsite_repodir" "${bundledir:A}" elif ! (( $#o_quiet )); then echo "MOCKGIT: Cloning into '${repo:t}'..." echo "MOCKGIT: Repository not found." echo "MOCKGIT: repository '$giturl' not found" fi elif [[ "$@" = "config remote.origin.url" ]]; then 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 if (( $#o_short )); then echo "abcd123" else echo "abcd1230abcd1230abcd1230abcd1230abcd1230" fi elif [[ "$1" == (submodule|fetch) ]]; then # nothing to do else echo >&2 "mocking not implemented for git command: git $@" return 1 fi #} antidote-1.9.10/tests/functions/normalize_aarr000066400000000000000000000016701500640522100215120ustar00rootroot00000000000000#!/bin/zsh #normalize_aarr() { emulate -L zsh; setopt local_options local MATCH MBEGIN MEND; local -a match mbegin mend # appease 'warn_create_global' local input key value array_name local -A assoc_array # Read from standard input while IFS= read -r input; do if [[ $input =~ '^typeset -A ([a-zA-Z_][a-zA-Z0-9_]*)=\((.*)\)$' ]]; then array_name=${match[1]} eval "assoc_array=( ${match[2]} )" # Print in the new format echo -n "typeset -A $array_name=(" for key in "${(@ok)assoc_array}"; do value=${assoc_array[$key]} quoted_value=${(q)value} # Apply (q) to check if quoting is needed # Use quoted_value only if it differs from value [[ $quoted_value != "$value" ]] && value=${(qq)value} echo -n " [$key]=$value" done echo " )" else echo "Error: Input does not match an associative array declaration" >&2 return 1 fi done #} antidote-1.9.10/tests/functions/print_aarr000066400000000000000000000015351500640522100206460ustar00rootroot00000000000000#!/bin/zsh #function print_aarr() { emulate -L zsh; setopt local_options local MATCH MBEGIN MEND; local -a match mbegin mend # appease 'warn_create_global' local input key val array_name local -A assoc_array # Read from standard input while IFS= read -r input; do if [[ $input =~ '^typeset -A ([a-zA-Z_][a-zA-Z0-9_]*)=\((.*)\)$' ]]; then array_name=${match[1]} printf '%-12s: %s\n' "\$assoc_arr" "${array_name}" eval "assoc_array=( ${match[2]} )" for key in ${(ok)assoc_array}; do val="$( print -r -- ${assoc_array[$key]} | subenv ANTIDOTE_HOME )" if [[ -z "$val" ]]; then printf '%-12s:\n' $key else printf '%-12s: %s\n' $key $val fi done else echo "Error: Input does not match an associative array declaration" >&2 return 1 fi done #} antidote-1.9.10/tests/functions/subenv000066400000000000000000000004461500640522100200070ustar00rootroot00000000000000#!/bin/zsh #function subenv { emulate -L zsh; setopt local_options if (( $# == 0 )); then 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[@]" #} antidote-1.9.10/tests/functions/t_reset000066400000000000000000000001531500640522100201450ustar00rootroot00000000000000#!/bin/zsh #function t_reset { 0=${(%):-%x} t_teardown t_setup source ${0:A:h:h:h}/antidote.zsh #} antidote-1.9.10/tests/functions/t_setup000066400000000000000000000031351500640522100201660ustar00rootroot00000000000000#!/bin/zsh #function t_setup { emulate -L zsh setopt local_options extended_glob glob_dots 0=${(%):-%x} typeset -g T_PRJDIR="${0:A:h:h:h}" typeset -g T_TESTDATA=$T_PRJDIR/tests/testdata local testdir="$T_PRJDIR/tests" # 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:*')"} ) source <(zstyle -L ':antidote:*' | awk '{print "zstyle -d",$2}') # setup test functions fpath+=( $testdir/functions ) autoload -Uz $testdir/functions/* # mock git function git { mockgit "$@" } # 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 tmp_home into position for p in $testdir/tmp_home/*; do cp -rf $p $T_TEMPDIR done # put testdata into position cp -rf -- $T_PRJDIR/tests $T_TEMPDIR/tests # rename .mockgit to .git local mockdir for mockdir in $T_TEMPDIR/**/.mock*; do mv $mockdir ${mockdir:s/.mock/.} done # our mock plugins use this typeset -ga plugins=() typeset -ga libs=() # setup antidote zstyle ':antidote:tests' set-warn-options 'on' zstyle ':antidote:tests' cloning 'off' zstyle ':antidote:bundle' use-friendly-names on zstyle ':antidote:defer' bundle 'getantidote/zsh-defer' # start from tmp home pushd cd $T_TEMPDIR # source antidote source $T_PRJDIR/antidote.zsh #} antidote-1.9.10/tests/functions/t_setup_real000066400000000000000000000016041500640522100211700ustar00rootroot00000000000000#!/bin/zsh #function t_setup_real { 0=${(%):-%x} # Setup for regular tests t_setup # Now undo some of the testing bits to run for real typeset -g T_PRJDIR="${0:A:h:h:h}" typeset -g T_TESTDATA=$T_PRJDIR/tests/testdata/real local testdir="$T_PRJDIR/tests" # undo setup so we clone for real zstyle ':antidote:tests' cloning 'on' (( $+functions[git] )) && unfunction git # unset other testing zstyles zstyle -d ':antidote:defer' bundle # unset rupa/z (( $+aliases[z] )) && unalias z # replace test versions of bundle files with real versions for file in .zsh_plugins.txt .zsh_plugins.zsh; do [[ -f $T_TESTDATA/$file ]] && command cp -f -- "$T_TESTDATA/$file" "$ZDOTDIR/$file" done # clean out antidote home [[ -d $ANTIDOTE_HOME ]] && command rm -rf -- "$ANTIDOTE_HOME" mkdir -p "$ANTIDOTE_HOME" # source antidote # source $T_PRJDIR/antidote.zsh #} antidote-1.9.10/tests/functions/t_teardown000066400000000000000000000016571500640522100206600ustar00rootroot00000000000000#!/bin/zsh #function t_teardown { emulate -L zsh setopt local_options # Return to project directory popd # reset current session HOME=$T_PREV_HOME ZDOTDIR=$T_PREV_ZDOTDIR # unfunction all antidote for fn in ${(k)functions}; do [[ $fn == *antidote* ]] && unfunction -- $fn done (( $+functions[git] )) && unfunction git # unfunction zsh-defer (( $+functions[zsh-defer] )) && unfunction zsh-defer # 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 tempdir [[ -d "$T_TEMPDIR" ]] && command rm -rf -- "$T_TEMPDIR" # remove vars for var in \ ANTIDOTE_HOME \ T_TEMPDIR \ T_PREV_HOME \ T_PREV_ZDOTDIR \ T_PREV_PATH \ T_PREV_FPATH \ plugins \ libs do [[ -v $var ]] && unset $var done #} antidote-1.9.10/tests/functions/t_unload_antidote000066400000000000000000000004471500640522100222020ustar00rootroot00000000000000#!/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 antidote-1.9.10/tests/test_alt_zsh_defer_bundle.md000066400000000000000000000014361500640522100222750ustar00rootroot00000000000000# antidote test alternative zsh-defer repo ## Setup ```zsh % source ./tests/__init__.zsh % t_setup % ``` ## Customize zsh-defer If the user forks zsh-defer, support setting a zstyle for an alternative repo location. ### General ```zsh % zstyle ':antidote:bundle' use-friendly-names on % zstyle ':antidote:defer' bundle 'custom/zsh-defer' % antidote bundle 'zsh-users/zsh-autosuggestions kind:defer' 2>/dev/null if ! (( $+functions[zsh-defer] )); then fpath+=( "$HOME/.cache/antidote/custom/zsh-defer" ) source "$HOME/.cache/antidote/custom/zsh-defer/zsh-defer.plugin.zsh" fi fpath+=( "$HOME/.cache/antidote/zsh-users/zsh-autosuggestions" ) zsh-defer source "$HOME/.cache/antidote/zsh-users/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh" % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_antidote.md000066400000000000000000000147211500640522100177430ustar00rootroot00000000000000# antidote bundle tests ## Setup ```zsh % source ./tests/__init__.zsh % t_setup % ``` ## Version Show antidote's version: ```zsh % antidote --version antidote version 1.9.10 (abcd123) % ``` ## 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 a repo at https://github.com/foobar/foo ```zsh % antidote bundle foobar/foo # antidote cloning foobar/foo... fpath+=( "$HOME/.cache/antidote/foobar/foo" ) source "$HOME/.cache/antidote/foobar/foo/foo.plugin.zsh" % ``` Bundle a repo at https://gitlab.com/foobar/bar ```zsh % antidote bundle https://gitlab.com/foobar/bar # antidote cloning foobar/bar... fpath+=( "$HOME/.cache/antidote/foobar/bar" ) source "$HOME/.cache/antidote/foobar/bar/bar.plugin.zsh" % ``` Bundle a repo at git@bitbucket.org:foobar/baz ```zsh % antidote bundle git@bitbucket.org:foobar/baz # antidote cloning foobar/baz... fpath+=( "$HOME/.cache/antidote/foobar/baz" ) source "$HOME/.cache/antidote/foobar/baz/baz.plugin.zsh" % ``` 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" % zstyle ':antidote:bundle' use-friendly-names on % ``` Bundle a specific branch of a repo with `branch:`. ```zsh % antidote bundle foobar/foo branch:dev # antidote cloning foobar/foo... fpath+=( "$HOME/.cache/antidote/foobar/foo" ) source "$HOME/.cache/antidote/foobar/foo/foo.plugin.zsh" % ``` Clean up ```zsh % t_reset % ``` ### 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.10 (abcd123) % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_antidote_core.md000066400000000000000000000037501500640522100207530ustar00rootroot00000000000000# antidote core tests Tests for antidote's most basic functionality. fails gracefully when someone tries bash ```zsh % bash -c "source ./antidote.zsh" antidote: Expecting zsh. Found 'bash'. % ``` ## Setup ```zsh % echo $+functions[antidote] 0 % source ./tests/__init__.zsh % t_setup % echo $+functions[antidote] 1 % git --version mockgit version 0.0.0 % ``` ## General No args displays help: ```zsh % antidote antidote - the cure to slow zsh plugin management usage: antidote [] [ ...] flags: -h, --help Show context-sensitive help -v, --version Show application version commands: help Show documentation load Statically source all bundles from the plugins file bundle Clone bundle(s) and generate the static load script install Clone a new bundle and add it to your plugins file update Update antidote and its cloned bundles purge Remove a cloned bundle home Print where antidote is cloning bundles list List cloned bundles path Print the path of a cloned bundle init Initialize the shell for dynamic bundles % ``` No arg exit status is 2: ```zsh % antidote >/dev/null; err=$? % echo $err 2 % ``` ## Help `-h` and `--help` work: ```zsh % antidote -h >/dev/null; err=$? % echo $err 0 % antidote --help >/dev/null; err=$? % echo $err 0 % ``` ## Version `-v` and `--version` work: ```zsh % antidote --version antidote version 1.9.10 (abcd123) % antidote -v >/dev/null; echo $? 0 % antidote --version >/dev/null; echo $? 0 % ``` ## Unrecognized options ```zsh % antidote --foo >/dev/null; err=$? #=> --regex (bad option|command not found) % echo $err 1 % ``` ## Unrecognized commands ```zsh % antidote foo; err=$? antidote: command not found 'foo' % echo $err 1 % ``` ## All commands ```zsh % cmds=( bundle help home init install list load path purge update main null ) % for cmd in $cmds; printf '%s' $+functions[antidote-$cmd]; echo 111111111110 % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_bundle_helpers.md000066400000000000000000000100121500640522100211140ustar00rootroot00000000000000# antidote bundle helper tests ## Setup ```zsh % TESTDATA=$PWD/tests/testdata % source ./tests/__init__.zsh % t_setup % antidote-bundle -h &>/dev/null % ``` ## Awk filter repos The repo parser pulls a list of all git URLs in a bundle file so that we can clone missing ones in parallel. ```zsh % __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/foo/baz & antidote-script --kind clone https://github.com/foo/qux & antidote-script --kind clone https://github.com/user/repo & antidote-script --kind clone user/repo & wait % ``` Test empty ```zsh % __antidote_bulk_clone $TESTDATA/.zsh_plugins_empty.txt wait % ``` ## Bundle parser Parse a simple repo: ```zsh % echo foo/bar | __antidote_parse_bundles antidote-script foo/bar % ``` ```zsh % echo 'https://github.com/foo/bar path:lib branch:dev' | __antidote_parse_bundles antidote-script --branch dev --path lib https://github.com/foo/bar % echo 'git@github.com:foo/bar.git kind:clone branch:main' | __antidote_parse_bundles antidote-script --branch main --kind clone git@github.com:foo/bar.git % echo 'foo/bar kind:fpath abc:xyz' | __antidote_parse_bundles antidote-script --abc xyz --kind fpath foo/bar % echo 'foo/bar path:plugins/myplugin kind:path # trailing comment' | __antidote_parse_bundles antidote-script --kind path --path plugins/myplugin foo/bar % ``` ```zsh % print 'foo/bar kind:defer\nbar/baz kind:defer\nbaz/qux kind:defer' | __antidote_parse_bundles antidote-script --kind defer foo/bar antidote-script --kind defer --skip-load-defer bar/baz antidote-script --kind defer --skip-load-defer baz/qux % ``` Handle funky whitespace ```zsh % cr=$'\r'; lf=$'\n'; tab=$'\t' % echo "foo/bar${tab}kind:path${cr}${lf}" | __antidote_parse_bundles antidote-script --kind path foo/bar % ``` The bundle parser needs to properly handle quoted annotations. ```zsh % bundle='foo/bar conditional:"is-macos || is-linux"' % __antidote_parser $bundle | print_aarr $assoc_arr : bundle _repo : foo/bar _repodir : foo/bar _type : repo _url : https://github.com/foo/bar conditional : is-macos || is-linux name : foo/bar % __antidote_parse_bundles $bundle antidote-script --conditional "is-macos || is-linux" foo/bar % antidote bundle $bundle if is-macos || is-linux; then fpath+=( "$HOME/.cache/antidote/foo/bar" ) source "$HOME/.cache/antidote/foo/bar/bar.plugin.zsh" fi % ``` ```zsh % bundle="foo/bar pre:'echo hello \$world' post:\"echo \\\"goodbye \$world\\\"\"" % echo $bundle foo/bar pre:'echo hello $world' post:"echo \"goodbye $world\"" % __antidote_parser $bundle | print_aarr $assoc_arr : bundle _repo : foo/bar _repodir : foo/bar _type : repo _url : https://github.com/foo/bar name : foo/bar post : echo "goodbye $world" pre : echo hello $world % __antidote_parse_bundles $bundle antidote-script --post "echo \"goodbye \$world\"" --pre "echo hello \$world" foo/bar % antidote bundle $bundle echo hello $world fpath+=( "$HOME/.cache/antidote/foo/bar" ) source "$HOME/.cache/antidote/foo/bar/bar.plugin.zsh" echo "goodbye $world" % ``` The bundle parser turns the bundle DSL into antidote-script statements. ```zsh % __antidote_parse_bundles < $ZDOTDIR/.zsh_plugins.txt antidote-script ~/foo/bar antidote-script --path plugins/myplugin \$ZSH_CUSTOM antidote-script foo/bar 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 antidote-script --path lib ohmy/ohmy antidote-script --path plugins/extract ohmy/ohmy antidote-script --kind defer --path plugins/magic-enter ohmy/ohmy antidote-script --path custom/themes/pretty.zsh-theme ohmy/ohmy % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_cmd_bundle.md000066400000000000000000000050361500640522100202270ustar00rootroot00000000000000# antidote bundle helper tests ## Setup ```zsh % source ./tests/__init__.zsh % t_setup % ``` ## Test bundle command Many 'bundle' tests could just as well just be 'script' tests, so we rely on 'test_script.md' to find scripting issues and use this to test actual bundling, or things not handled by 'antidote script'. You can think of 'antidote script' as handling a single bundle, and 'antidote bundle' handling them in bulk. ### General ```zsh % # antidote bundle % ``` ```zsh % antidote bundle <$ZDOTDIR/.zsh_plugins.txt >$ZDOTDIR/.zsh_plugins.zsh % cat $ZDOTDIR/.zsh_plugins.zsh | subenv #=> --file testdata/.zsh_plugins.zsh % ``` ### Multiple ways to call bundle Test \|piping, \ --file testdata/script-foobar.zsh % echo 'foo/bar' | antidote bundle | subenv ANTIDOTE_HOME #=> --file testdata/script-foobar.zsh % echo 'git@github.com:foo/qux' >$ZDOTDIR/.zsh_plugins_simple.txt % antidote bundle <$ZDOTDIR/.zsh_plugins_simple.txt | subenv ANTIDOTE_HOME #=> --file testdata/script-fooqux.zsh % ``` ### Do the same thing, but with antibody mode this time Test \|piping, \ --file testdata/antibody/script-foobar.zsh % echo 'foo/bar' | antidote bundle | subenv ANTIDOTE_HOME #=> --file testdata/antibody/script-foobar.zsh % echo 'git@github.com:foo/qux' >$ZDOTDIR/.zsh_plugins_simple.txt % antidote bundle <$ZDOTDIR/.zsh_plugins_simple.txt | subenv ANTIDOTE_HOME #=> --file testdata/antibody/script-fooqux.zsh % zstyle ':antidote:compatibility-mode' 'antibody' 'off' % ANTIDOTE_HOME=$HOME/.cache/antidote % zstyle ':antidote:bundle' use-friendly-names on % ``` Multiple defers ```zsh % antidote bundle 'foo/bar kind:defer\nbar/baz 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/foo/bar" ) zsh-defer source "$ANTIDOTE_HOME/foo/bar/bar.plugin.zsh" fpath+=( "$ANTIDOTE_HOME/bar/baz" ) zsh-defer source "$ANTIDOTE_HOME/bar/baz/baz.plugin.zsh" % ``` ## Fails ```zsh % echo "foo/bar\nfoo/baz kind:whoops" | antidote bundle 2>&1 >/dev/null antidote: error: unexpected kind value: 'whoops' % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_cmd_help.md000066400000000000000000000106071500640522100177060ustar00rootroot00000000000000# antidote help tests ## Setup ```zsh % source ./tests/__init__.zsh % t_setup % ``` ## General `antidote help` command exists ```zsh % antidote help &>/dev/null; echo $? 0 % ``` `antidote --h/--help` works ```zsh % antidote -h &>/dev/null; echo $? 0 % antidote --help &>/dev/null; echo $? 0 % ``` `antidote` man pages work ```zsh % PAGER=cat man antidote | head -n 1 | sed 's/ */ /g' antidote(1) Antidote Manual antidote(1) % ``` `antidote` man pages are in `$MANPATH` ```zsh % [[ "$MANPATH" == *"$T_PRJDIR/man:"* ]] || echo "MANPATH not set properly" % ``` ## antidote-bundle ```zsh % antidote help bundle | head -n 1 | sed 's/ */ /g' antidote-bundle(1) Antidote Manual antidote-bundle(1) % antidote bundle --help | head -n 1 | sed 's/ */ /g' antidote-bundle(1) Antidote Manual antidote-bundle(1) % antidote bundle -h | head -n 1 | sed 's/ */ /g' antidote-bundle(1) Antidote Manual antidote-bundle(1) % ``` ## antidote-help ```zsh % antidote help help | head -n 1 | sed 's/ */ /g' antidote-help(1) Antidote Manual antidote-help(1) % antidote help --help | head -n 1 | sed 's/ */ /g' antidote-help(1) Antidote Manual antidote-help(1) % antidote help -h | head -n 1 | sed 's/ */ /g' antidote-help(1) Antidote Manual antidote-help(1) % ``` ## antidote-home ```zsh % antidote help home | head -n 1 | sed 's/ */ /g' antidote-home(1) Antidote Manual antidote-home(1) % antidote home --help | head -n 1 | sed 's/ */ /g' antidote-home(1) Antidote Manual antidote-home(1) % antidote home -h | head -n 1 | sed 's/ */ /g' antidote-home(1) Antidote Manual antidote-home(1) % ``` ## antidote-init ```zsh % antidote help init | head -n 1 | sed 's/ */ /g' antidote-init(1) Antidote Manual antidote-init(1) % antidote init --help | head -n 1 | sed 's/ */ /g' antidote-init(1) Antidote Manual antidote-init(1) % antidote init -h | head -n 1 | sed 's/ */ /g' antidote-init(1) Antidote Manual antidote-init(1) % ``` ## antidote-install ```zsh % antidote help install | head -n 1 | sed 's/ */ /g' antidote-install(1) Antidote Manual antidote-install(1) % antidote install --help | head -n 1 | sed 's/ */ /g' antidote-install(1) Antidote Manual antidote-install(1) % antidote install -h | head -n 1 | sed 's/ */ /g' antidote-install(1) Antidote Manual antidote-install(1) % ``` ## antidote-list ```zsh % antidote help list | head -n 1 | sed 's/ */ /g' antidote-list(1) Antidote Manual antidote-list(1) % antidote list --help | head -n 1 | sed 's/ */ /g' antidote-list(1) Antidote Manual antidote-list(1) % antidote list -h | head -n 1 | sed 's/ */ /g' antidote-list(1) Antidote Manual antidote-list(1) % ``` ## antidote-load ```zsh % antidote help load | head -n 1 | sed 's/ */ /g' antidote-load(1) Antidote Manual antidote-load(1) % antidote load --help | head -n 1 | sed 's/ */ /g' antidote-load(1) Antidote Manual antidote-load(1) % antidote load -h | head -n 1 | sed 's/ */ /g' antidote-load(1) Antidote Manual antidote-load(1) % ``` ## antidote-path ```zsh % antidote help path | head -n 1 | sed 's/ */ /g' antidote-path(1) Antidote Manual antidote-path(1) % antidote path --help | head -n 1 | sed 's/ */ /g' antidote-path(1) Antidote Manual antidote-path(1) % antidote path -h | head -n 1 | sed 's/ */ /g' antidote-path(1) Antidote Manual antidote-path(1) % ``` ## antidote-update ```zsh % antidote help update | head -n 1 | sed 's/ */ /g' antidote-update(1) Antidote Manual antidote-update(1) % antidote update --help | head -n 1 | sed 's/ */ /g' antidote-update(1) Antidote Manual antidote-update(1) % antidote update -h | head -n 1 | sed 's/ */ /g' antidote-update(1) Antidote Manual antidote-update(1) % ``` ## antidote-foo ```zsh % antidote help foo No manual entry for antidote-foo 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 % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_cmd_home.md000066400000000000000000000030301500640522100176760ustar00rootroot00000000000000# antidote home tests ## Setup ```zsh % source ./tests/__init__.zsh % t_setup % ``` ## General `antidote home` command exists ```zsh % antidote home &>/dev/null; echo $? 0 % ``` `antidote home --h/--help` works ```zsh % antidote home -h &>/dev/null; echo $? 0 % antidote home --help &>/dev/null; echo $? 0 % ``` `$ANTIDOTE_HOME` is used if set... ```zsh % ANTIDOTE_HOME=$HOME/.cache/antidote % antidote home | subenv HOME $HOME/.cache/antidote % unset ANTIDOTE_HOME % ``` `antidote home` is `~/Library/Caches/antidote` on macOS ```zsh % OLD_OSTYPE=$OSTYPE; OSTYPE=darwin21.3.0 % antidote home | subenv HOME $HOME/Library/Caches/antidote % OSTYPE=$OLD_OSTYPE % ``` `antidote home` is `$LOCALAPPDATA/antidote` on msys ```zsh % OLD_OSTYPE=$OSTYPE; OSTYPE=msys % LOCALAPPDATA=$HOME/AppData % antidote home | subenv HOME $HOME/AppData/antidote % OSTYPE=$OLD_OSTYPE % ``` `antidote home` uses `$XDG_CACHE_HOME` on an OS that defines it. ```zsh % # Setup % OLD_OSTYPE=$OSTYPE; OSTYPE=foobar % OLD_XDG_CACHE_HOME=$XDG_CACHE_HOME; XDG_CACHE_HOME=$HOME/.xdg-cache % # Run test % antidote home | subenv XDG_CACHE_HOME $XDG_CACHE_HOME/antidote % # Teardown % OSTYPE=$OLD_OSTYPE; XDG_CACHE_HOME=$OLD_XDG_CACHE_HOME % ``` `antidote home` uses `$HOME/.cache` otherwise. ```zsh % # Setup % OLD_OSTYPE=$OSTYPE; OSTYPE=foobar % OLD_XDG_CACHE_HOME=$XDG_CACHE_HOME; XDG_CACHE_HOME= % # Run test % antidote home | subenv HOME $HOME/.cache/antidote % # Teardown % OSTYPE=$OLD_OSTYPE; XDG_CACHE_HOME=$OLD_XDG_CACHE_HOME % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_cmd_init.md000066400000000000000000000012431500640522100177150ustar00rootroot00000000000000# antidote init tests ## Setup ```zsh % source ./tests/__init__.zsh % t_setup % ``` ## Init ```zsh % antidote init #!/usr/bin/env zsh function antidote { case "$1" in bundle) source <( antidote-main $@ ) || antidote-main $@ ;; *) antidote-main $@ ;; esac } % ``` Load plugins dynamically ```zsh % source <(antidote init) % antidote bundle foo/bar sourcing foo/bar... % antidote bundle foo/baz autoload:functions sourcing foo/baz... % antidote bundle $ZDOTDIR/custom/lib sourcing custom lib1.zsh... sourcing custom lib2.zsh... % echo $#plugins 2 % echo $#libs 2 % echo $+functions[baz] 1 % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_cmd_install.md000066400000000000000000000021541500640522100204220ustar00rootroot00000000000000# antidote installs tests ## Setup ```zsh % source ./tests/__init__.zsh % t_setup % ``` ## Install Command `antidote install` requires a `` argument. ```zsh % antidote install #=> --exit 1 antidote: error: required argument 'bundle' not provided, try --help % ``` 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/foo/bar % ``` Install a bundle ```zsh % antidote install rupa/z | subenv ZDOTDIR # antidote cloning rupa/z... Adding bundle to '$ZDOTDIR/.zsh_plugins.txt': rupa/z % tail -n 1 $ZDOTDIR/.zsh_plugins.txt rupa/z % ``` Install a complicated bundle ```zsh % antidote install --path plugins/macos --conditional is-macos ohmyzsh/ohmyzsh | subenv ZDOTDIR # antidote cloning ohmyzsh/ohmyzsh... Adding bundle to '$ZDOTDIR/.zsh_plugins.txt': ohmyzsh/ohmyzsh path:plugins/macos conditional:is-macos % tail -n 1 $ZDOTDIR/.zsh_plugins.txt ohmyzsh/ohmyzsh path:plugins/macos conditional:is-macos % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_cmd_list.md000066400000000000000000000024171500640522100177310ustar00rootroot00000000000000# antidote list tests ## Setup ```zsh % source ./tests/__init__.zsh % t_setup % ``` ## List Command ### Short `antidote list --short` ```zsh % antidote list --short | subenv ANTIDOTE_HOME foo/bar foo/baz getantidote/zsh-defer git@github.com:foo/qux ohmy/ohmy % ``` ### Directories `antidote list --dirs` ```zsh % antidote list --dirs | subenv ANTIDOTE_HOME $ANTIDOTE_HOME/foo/bar $ANTIDOTE_HOME/foo/baz $ANTIDOTE_HOME/foo/qux $ANTIDOTE_HOME/getantidote/zsh-defer $ANTIDOTE_HOME/ohmy/ohmy % ``` ### URLs `antidote list --url` ```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 % ``` ### Full `antidote list` ```zsh % antidote list | subenv ANTIDOTE_HOME 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 % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_cmd_load.md000066400000000000000000000030341500640522100176710ustar00rootroot00000000000000# antidote load tests ## Setup ```zsh % source ./tests/__init__.zsh % t_setup % ``` ### General ```zsh % antidote load $ZDOTDIR/.zplugins_fake_load sourcing foo/bar... sourcing foo/qux... sourcing foo/bar... sourcing ohmy/lib/lib1.zsh... sourcing ohmy/lib/lib2.zsh... sourcing ohmy/lib/lib3.zsh... sourcing extract.plugin.zsh... sourcing docker.plugin.zsh... sourcing docker.plugin.zsh... 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 % # cleanup % t_reset % ``` ### zstyles ```zsh % cp $ZDOTDIR/.zplugins_fake_load $ZDOTDIR/.zplugins.txt % 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 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 foo/qux... sourcing foo/bar... sourcing ohmy/lib/lib1.zsh... sourcing ohmy/lib/lib2.zsh... sourcing ohmy/lib/lib3.zsh... sourcing extract.plugin.zsh... sourcing docker.plugin.zsh... sourcing docker.plugin.zsh... 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 % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_cmd_main.md000066400000000000000000000016031500640522100176760ustar00rootroot00000000000000# antidote main tests ## Setup ```zsh % source ./tests/__init__.zsh % t_setup % ``` ## Test main Main is core to everything, so we don't need to test much here. ```zsh % antidote-main --version &>/dev/null #=> --exit 0 % ``` ## Lazy config Tests for lazy-loading antidote. - Fix [#54](https://github.com/mattmc3/antidote/issues/54) ```zsh % # Unload antidote % echo $+functions[antidote-main] 1 % t_unload_antidote % echo $+functions[antidote-main] 0 % # Now, lazy load it and make sure it works % autoload -Uz $T_PRJDIR/antidote % antidote -v &>/dev/null; echo $? 0 % # Now, tear down again % echo $+functions[antidote-main] 1 % t_unload_antidote % echo $+functions[antidote-main] 0 % # Now, lazy load from the functions dir % autoload -Uz $T_PRJDIR/functions/antidote % antidote -v &>/dev/null; echo $? 0 % echo $+functions[antidote-main] 1 % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_cmd_path.md000066400000000000000000000016501500640522100177100ustar00rootroot00000000000000# antidote path tests ## Setup ```zsh % source ./tests/__init__.zsh % t_setup % ``` ## Path Command `antidote-path` prints path to bundle. ```zsh % antidote path foo/bar &>/dev/null #=> --exit 0 % antidote path foo/bar | subenv ANTIDOTE_HOME $ANTIDOTE_HOME/foo/bar % ``` `antidote-path` fails on missing bundles ```zsh % antidote path bar/foo &>/dev/null #=> --exit 1 % antidote path bar/foo; err=$? antidote: error: bar/foo does not exist in cloned paths % echo $err 1 % ``` `antidote-path` accepts piped input ```zsh % 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 % ``` `antidote-path` expands vars ```zsh % ZSH_CUSTOM=$ZDOTDIR/custom % antidote path '$ZSH_CUSTOM/plugins/myplugin' | subenv $HOME/.zsh/custom/plugins/myplugin % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_cmd_purge.md000066400000000000000000000037021500640522100200760ustar00rootroot00000000000000# antidote purge tests ## Setup ```zsh % source ./tests/__init__.zsh % t_setup % ``` ## Purge Command `antidote purge` requires a `` argument. ```zsh % antidote purge &>/dev/null #=> --exit 1 % antidote purge antidote: error: required argument 'bundle' not provided, try --help % ``` 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/bar/foo % ``` Purging a bundle deletes the directory and comments out instances of the bundle in `.zsh_plugins.txt`. ```zsh % # bundle dir exists % bundledir=$ANTIDOTE_HOME/foo/bar % test -d $bundledir #=> --exit 0 % # purge works % antidote purge foo/bar | subenv ZDOTDIR Removed 'foo/bar'. Bundle 'foo/bar' was commented out in '$ZDOTDIR/.zsh_plugins.txt'. % # bundle dir was removed % test -d $bundledir #=> --exit 1 % cat $ZDOTDIR/.zsh_plugins.txt #=> --file ./testdata/.zsh_plugins_purged.txt % ``` Test that `antidote purge --all` aborts when told "no". ```zsh % function test_exists { [[ -e "$1" ]] } % zstyle ':antidote:purge:all' answer 'n' % antidote purge --all #=> --exit 1 % antidote list | subenv ANTIDOTE_HOME 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 % ``` Test that `antidote purge --all` does the work when told "yes". ```zsh % function test_exists { [[ -e "$1" ]] } % zstyle ':antidote:purge:all' answer 'y' % antidote purge --all | tail -n 1 Antidote purge complete. Be sure to start a new Zsh session. % antidote list | wc -l | awk '{print $1}' 0 % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_cmd_script.md000066400000000000000000000211531500640522100202600ustar00rootroot00000000000000# antidote-script tests ## Setup ```zsh % source ./tests/__init__.zsh % t_setup % ``` ## Script Command ### Fails ```zsh % antidote-script #=> --exit 1 % antidote-script antidote: error: bundle argument expected % ``` ### Arg style `antidote-script` accepts '--arg val', '--arg:val', '--arg=val' syntax ```zsh % antidote-script --kind zsh foo/bar #=> --exit 0 % antidote-script --kind:zsh foo/bar #=> --exit 0 % antidote-script --kind=zsh foo/bar #=> --exit 0 % antidote-script --kind+zsh foo/bar #=> --exit 1 % ``` ### Scripting types `antidote-script` works with local files and directories, as well as remote repos. Script a file: ```zsh % antidote-script $ZDOTDIR/aliases.zsh | subenv ZDOTDIR source "$ZDOTDIR/aliases.zsh" % ``` Script a lib directory: ```zsh % antidote-script $ZDOTDIR/custom/lib | subenv ZDOTDIR fpath+=( "$ZDOTDIR/custom/lib" ) source "$ZDOTDIR/custom/lib/lib1.zsh" source "$ZDOTDIR/custom/lib/lib2.zsh" % ``` Script a plugin directory: ```zsh % antidote-script $ZDOTDIR/custom/plugins/myplugin | subenv ZDOTDIR fpath+=( "$ZDOTDIR/custom/plugins/myplugin" ) source "$ZDOTDIR/custom/plugins/myplugin/myplugin.plugin.zsh" % ``` 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/antibody/script-foobar.zsh % antidote-script https://github.com/foo/bar | subenv ANTIDOTE_HOME #=> --file ./testdata/antibody/script-foobar.zsh % antidote-script https://github.com/foo/bar.git | subenv ANTIDOTE_HOME #=> --file ./testdata/antibody/script-foobar.zsh % antidote-script git@github.com:foo/qux.git | subenv ANTIDOTE_HOME #=> --file ./testdata/antibody/script-fooqux.zsh % zstyle ':antidote:bundle' use-friendly-names on % ANTIDOTE_HOME=$HOME/.cache/antidote % ``` ## Annotations ### kind:clone Nothing happens when the plugin already exists. ```zsh % antidote-script --kind clone foo/bar % ``` Clone a missing plugin. ```zsh % antidote-script --kind clone bar/foo # antidote cloning bar/foo... % ``` ### kind:zsh ```zsh % antidote-script --kind zsh foo/bar | subenv ANTIDOTE_HOME fpath+=( "$ANTIDOTE_HOME/foo/bar" ) source "$ANTIDOTE_HOME/foo/bar/bar.plugin.zsh" % ``` ### kind:path ```zsh % antidote-script --kind path foo/bar | subenv ANTIDOTE_HOME export PATH="$ANTIDOTE_HOME/foo/bar:$PATH" % ``` ### kind:fpath ```zsh % antidote-script --kind fpath foo/bar | subenv ANTIDOTE_HOME fpath+=( "$ANTIDOTE_HOME/foo/bar" ) % ``` ### kind:autoload ```zsh % antidote-script --kind autoload $ZDOTDIR/functions | subenv ZDOTDIR fpath+=( "$ZDOTDIR/functions" ) builtin autoload -Uz $fpath[-1]/*(N.:t) % ``` ### kind:defer ```zsh % antidote-script --kind defer foo/bar | 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/foo/bar" ) zsh-defer source "$ANTIDOTE_HOME/foo/bar/bar.plugin.zsh" % ``` Test skipping defer loading ```zsh % antidote-script --kind defer --skip-load-defer foo/bar | subenv ANTIDOTE_HOME fpath+=( "$ANTIDOTE_HOME/foo/bar" ) zsh-defer source "$ANTIDOTE_HOME/foo/bar/bar.plugin.zsh" % ``` Test defer zstyle settings ```zsh % zstyle ':antidote:bundle:*' defer-options '-a' % 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/getantidote/zsh-defer" ) source "$ANTIDOTE_HOME/getantidote/zsh-defer/zsh-defer.plugin.zsh" fi 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 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/bar/baz" ) zsh-defer -a source "$ANTIDOTE_HOME/bar/baz/baz.plugin.zsh" % # cleanup % t_reset % ``` ### path:plugin-dir ```zsh % antidote-script --path plugins/extract ohmy/ohmy | subenv ANTIDOTE_HOME fpath+=( "$ANTIDOTE_HOME/ohmy/ohmy/plugins/extract" ) source "$ANTIDOTE_HOME/ohmy/ohmy/plugins/extract/extract.plugin.zsh" % ``` ### path:file ```zsh % antidote-script --path lib/lib1.zsh ohmy/ohmy | subenv ANTIDOTE_HOME source "$ANTIDOTE_HOME/ohmy/ohmy/lib/lib1.zsh" % ``` ### path:lib-dir ```zsh % antidote-script --path lib ohmy/ohmy | subenv ANTIDOTE_HOME 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" % ``` ### path:theme ```zsh % antidote-script --path themes/pretty.zsh-theme ohmy/ohmy | subenv ANTIDOTE_HOME source "$ANTIDOTE_HOME/ohmy/ohmy/themes/pretty.zsh-theme" % ``` ### conditional:testfunc ```zsh % antidote-script --conditional is-macos --path plugins/macos ohmy/ohmy | subenv ANTIDOTE_HOME if is-macos; then fpath+=( "$ANTIDOTE_HOME/ohmy/ohmy/plugins/macos" ) source "$ANTIDOTE_HOME/ohmy/ohmy/plugins/macos/macos.plugin.zsh" fi % ``` ### autoload:funcdir ```zsh % antidote-script --path plugins/macos --autoload functions ohmy/ohmy | subenv ANTIDOTE_HOME fpath+=( "$ANTIDOTE_HOME/ohmy/ohmy/plugins/macos/functions" ) builtin autoload -Uz $fpath[-1]/*(N.:t) fpath+=( "$ANTIDOTE_HOME/ohmy/ohmy/plugins/macos" ) source "$ANTIDOTE_HOME/ohmy/ohmy/plugins/macos/macos.plugin.zsh" % ``` ### fpath-rule:append/prepend ```zsh % # append % antidote-script --fpath-rule append --path plugins/docker ohmy/ohmy | subenv ANTIDOTE_HOME 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/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' % ``` ### pre/post functions ```zsh % # pre % antidote-script --pre run_before foo/bar | subenv ANTIDOTE_HOME run_before 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/foo/bar" ) source "$ANTIDOTE_HOME/foo/bar/bar.plugin.zsh" run_after % ``` If a plugin is deferred, so is its post event ```zsh % 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/getantidote/zsh-defer" ) source "$ANTIDOTE_HOME/getantidote/zsh-defer/zsh-defer.plugin.zsh" fi fpath+=( "$ANTIDOTE_HOME/foo/bar" ) zsh-defer source "$ANTIDOTE_HOME/foo/bar/bar.plugin.zsh" zsh-defer post-event % ``` ## Private functions ### \_\_antidote_initfiles setup ```zsh % # load __antidote_initfiles from private funcs in antidote-script % antidote-script -h &>/dev/null % PLUGINDIR=$T_TEMPDIR/initfiles/myplugin % mkdir -p $PLUGINDIR % touch $PLUGINDIR/myplugin.plugin.zsh % touch $PLUGINDIR/whatever.plugin.zsh % touch $PLUGINDIR/file.zsh % touch $PLUGINDIR/file.sh % touch $PLUGINDIR/file.bash % touch $PLUGINDIR/mytheme.zsh-theme % touch $PLUGINDIR/README.md % touch $PLUGINDIR/file % mkdir -p $PLUGINDIR/lib % touch $PLUGINDIR/lib/lib1.zsh % touch $PLUGINDIR/lib/lib2.zsh % touch $PLUGINDIR/lib/lib3.zsh % ``` myplugin.plugin.zsh ```zsh % __antidote_initfiles $PLUGINDIR | subenv PLUGINDIR $PLUGINDIR/myplugin.plugin.zsh % rm $PLUGINDIR/myplugin.plugin.zsh % ``` whatever.plugin.zsh ```zsh % __antidote_initfiles $PLUGINDIR | subenv PLUGINDIR $PLUGINDIR/whatever.plugin.zsh % rm $PLUGINDIR/whatever.plugin.zsh % ``` file.zsh ```zsh % __antidote_initfiles $PLUGINDIR | subenv PLUGINDIR $PLUGINDIR/file.zsh % rm $PLUGINDIR/file.zsh % ``` file.sh ```zsh % __antidote_initfiles $PLUGINDIR | subenv PLUGINDIR $PLUGINDIR/file.sh % rm $PLUGINDIR/file.sh % ``` mytheme.zsh-theme ```zsh % __antidote_initfiles $PLUGINDIR | subenv PLUGINDIR $PLUGINDIR/mytheme.zsh-theme % rm $PLUGINDIR/mytheme.zsh-theme % ``` lib ```zsh % __antidote_initfiles $PLUGINDIR/lib | subenv PLUGINDIR $PLUGINDIR/lib/lib1.zsh $PLUGINDIR/lib/lib2.zsh $PLUGINDIR/lib/lib3.zsh % ``` FAIL: no files left that match ```zsh % __antidote_initfiles $PLUGINDIR #=> --exit 1 % ``` FAIL: Empty ```zsh % PLUGINDIR=$T_TEMPDIR/initfiles/foo % mkdir -p $PLUGINDIR % __antidote_initfiles $PLUGINDIR #=> --exit 1 % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_cmd_update.md000066400000000000000000000012161500640522100202340ustar00rootroot00000000000000# antidote update tests ## Setup ```zsh % source ./tests/__init__.zsh % t_setup % ``` ## Update ```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.10 (abcd123) % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_fpath_rules.md000066400000000000000000000056131500640522100204500ustar00rootroot00000000000000# antidote bundle fpath-rule: ## Setup ```zsh % source ./tests/__init__.zsh % t_setup % ``` 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 % ``` antidote-1.9.10/tests/test_helpers.md000066400000000000000000000121771500640522100176010ustar00rootroot00000000000000# antidote helper tests ## Setup ```zsh % source ./tests/__init__.zsh % t_setup % ``` ## Safe removal Appease my paranoia and ensure that you can't remove a path you shouldn't be able to: ```zsh % __antidote_del -rf -- /foo/bar antidote: Blocked attempt to rm path: '/foo/bar'. % ``` ## Pretty print path ```zsh % __antidote_print_path /foo/bar /foo/bar % __antidote_print_path $HOME/foo/bar $HOME/foo/bar % zstyle ':antidote:compatibility-mode' 'antibody' 'on' % __antidote_print_path $HOME/foo/bar | subenv T_TEMPDIR $T_TEMPDIR/foo/bar % zstyle -d ':antidote:compatibility-mode' 'antibody' % ``` ## Bundle type ```zsh % __antidote_bundle_type $T_PRJDIR/antidote.zsh file % __antidote_bundle_type $T_PRJDIR/functions dir % __antidote_bundle_type '$T_PRJDIR/antidote.zsh' file % __antidote_bundle_type \$T_PRJDIR/functions dir % __antidote_bundle_type 'git@github.com:foo/bar.git' sshurl % __antidote_bundle_type 'https://github.com/foo/bar' url % __antidote_bundle_type 'https:/bad.com/foo/bar.git' ? % __antidote_bundle_type '' empty % __antidote_bundle_type ' ' empty % __antidote_bundle_type /foo/bar path % __antidote_bundle_type /foobar path % __antidote_bundle_type foobar/ relpath % __antidote_bundle_type '~/foo/bar' path % __antidote_bundle_type '$foo/bar' path % __antidote_bundle_type \$ZDOTDIR/foo path % __antidote_bundle_type \$ZDOTDIR/.zsh_plugins.txt file % touch ~/.zshenv % __antidote_bundle_type '~/.zshenv' file % __antidote_bundle_type '~/null' path % __antidote_bundle_type foo/bar repo % __antidote_bundle_type bar/baz.git repo % __antidote_bundle_type foo/bar/baz relpath % __antidote_bundle_type foobar word % __antidote_bundle_type foo bar baz word % __antidote_bundle_type 'foo bar baz' word % ``` ## Bundle name ```zsh % __antidote_bundle_name $HOME/.zsh/custom/lib/lib1.zsh $HOME/.zsh/custom/lib/lib1.zsh % __antidote_bundle_name $HOME/.zsh/plugins/myplugin $HOME/.zsh/plugins/myplugin % __antidote_bundle_name 'git@github.com:foo/bar.git' foo/bar % __antidote_bundle_name 'https://github.com/foo/bar' foo/bar % __antidote_bundle_name 'https:/bad.com/foo/bar.git' https:/bad.com/foo/bar.git % __antidote_bundle_name '' % __antidote_bundle_name /foo/bar /foo/bar % __antidote_bundle_name /foobar /foobar % __antidote_bundle_name foobar/ foobar/ % __antidote_bundle_name '~/foo/bar' $HOME/foo/bar % __antidote_bundle_name '$foo/bar' $foo/bar % __antidote_bundle_name foo/bar foo/bar % __antidote_bundle_name bar/baz.git bar/baz.git % __antidote_bundle_name foo/bar/baz foo/bar/baz % __antidote_bundle_name foobar foobar % __antidote_bundle_name foo bar baz foo % __antidote_bundle_name 'foo bar baz' 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 % # repo url % __antidote_bundle_dir https://github.com/foo/bar | subenv ANTIDOTE_HOME $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar % # repo url.git % __antidote_bundle_dir https://github.com/foo/bar.git | subenv ANTIDOTE_HOME $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar % # repo ssh % __antidote_bundle_dir git@github.com:foo/bar.git | subenv ANTIDOTE_HOME $ANTIDOTE_HOME/git-AT-github.com-COLON-foo-SLASH-bar % # local dir % __antidote_bundle_dir ~/foo/bar | subenv HOME $HOME/foo/bar % # another local dir % __antidote_bundle_dir $ZDOTDIR/bar/baz | subenv ZDOTDIR $ZDOTDIR/bar/baz % ``` Use friendly names ```zsh % # short repo - friendly name % zstyle ':antidote:bundle' use-friendly-names on % __antidote_bundle_dir foo/bar | subenv ANTIDOTE_HOME $ANTIDOTE_HOME/foo/bar % # repo url - friendly name % __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:foo/qux.git | subenv ANTIDOTE_HOME $ANTIDOTE_HOME/foo/qux % ``` ### To URL Short repos: ```zsh % __antidote_tourl ohmyzsh/ohmyzsh https://github.com/ohmyzsh/ohmyzsh % __antidote_tourl sindresorhus/pure https://github.com/sindresorhus/pure % __antidote_tourl foo/bar https://github.com/foo/bar % ``` Proper URLs don't change: ```zsh % __antidote_tourl https://github.com/ohmyzsh/ohmyzsh https://github.com/ohmyzsh/ohmyzsh % __antidote_tourl http://github.com/ohmyzsh/ohmyzsh http://github.com/ohmyzsh/ohmyzsh % __antidote_tourl ssh://github.com/ohmyzsh/ohmyzsh ssh://github.com/ohmyzsh/ohmyzsh % __antidote_tourl git://github.com/ohmyzsh/ohmyzsh git://github.com/ohmyzsh/ohmyzsh % __antidote_tourl ftp://github.com/ohmyzsh/ohmyzsh ftp://github.com/ohmyzsh/ohmyzsh % __antidote_tourl git@github.com:sindresorhus/pure.git git@github.com:sindresorhus/pure.git % ``` ## Collect input If we \ --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 tmp_home/.zsh/.zsh_plugins.txt % ``` If we pass argument it should output that. ```zsh % __antidote_collect_input 'a\nb\nc\n' a b c % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_mockgit.md000066400000000000000000000025631500640522100175720ustar00rootroot00000000000000# Test git mocking ```zsh % source ./tests/__init__.zsh % function git { mockgit "$@" } % ``` Mock: `git --version` ```zsh % git --version mockgit version 0.0.0 % ``` Mock: SHA ```zsh % git rev-parse HEAD abcd1230abcd1230abcd1230abcd1230abcd1230 % git rev-parse --short HEAD abcd123 % ``` Mock: pull ```zsh % git pull --quiet % git pull MOCKGIT: Already up to date. % ``` Mock: clone Setup... ```zsh % T_TEMPDIR=${$(mktemp -d -t t_antidote.XXXXXXXX):A} % ``` ```zsh % % test -d $T_TEMPDIR/fakeuser #=> --exit 1 % git clone --quiet --depth 1 --recurse-submodules --shallow-submodules https://fakegitsite.com/fakeuser/fakerepo $T_TEMPDIR/fakeuser % test -d $T_TEMPDIR/fakeuser #=> --exit 0 % test -e $T_TEMPDIR/fakeuser/fakerepo/fakerepo.plugin.zsh #=> --exit 0 % ``` Clean up ```zsh % rm -rf -- $T_TEMPDIR % ``` Mock: clone missing ```zsh % git clone --depth 1 --recurse-submodules --shallow-submodules https://fakegitsite.com/testy/mctestface MOCKGIT: Cloning into 'mctestface'... MOCKGIT: Repository not found. MOCKGIT: repository 'https://fakegitsite.com/testy/mctestface' not found % ``` Mock: no-op commands ```zsh % git submodule sync #=> --exit 0 % git submodule sync % git submodule update #=> --exit 0 % git submodule update % ``` Mock: non-recognized ```zsh % git status -sb #=> --exit 1 % git status -sb mocking not implemented for git command: git status -sb % ``` antidote-1.9.10/tests/test_parser.md000066400000000000000000000057601500640522100174330ustar00rootroot00000000000000# antidote bundle parser tests ## Setup ```zsh % source ./tests/__init__.zsh % t_setup % zstyle ':antidote:gitremote' url 'https://fakegitsite.com/' % ``` ## Test bundle parser associative arrays The bundle parser takes the antidote bundle format and returns an associative array from the results of `declare -p parsed_bundle` Test empty: ```zsh % __antidote_parser % __antidote_parser '# This is a full line comment' % ``` Test assoc array for repo ```zsh % __antidote_parser 'foo/bar' | print_aarr $assoc_arr : bundle _repo : foo/bar _repodir : foo/bar _type : repo _url : https://fakegitsite.com/foo/bar name : foo/bar % ``` Test assoc array for repo in compatibility mode ```zsh % zstyle ':antidote:bundle' use-friendly-names off % __antidote_parser 'foo/bar' | print_aarr $assoc_arr : bundle _repo : foo/bar _repodir : https-COLON--SLASH--SLASH-fakegitsite.com-SLASH-foo-SLASH-bar _type : repo _url : https://fakegitsite.com/foo/bar name : foo/bar % zstyle ':antidote:bundle' use-friendly-names on % ``` Test assoc array for path ```zsh % __antidote_parser '$ZSH_CUSTOM/foo' 'mybundle' | print_aarr $assoc_arr : mybundle _type : path name : $ZSH_CUSTOM/foo % ``` Test assoc array for jibberish ```zsh % __antidote_parser 'a b c d:e:f' | print_aarr $assoc_arr : bundle _type : ? b : c : d : e:f name : a % __antidote_parser 'foo bar:baz' | print_aarr $assoc_arr : bundle _type : ? bar : baz name : foo % ``` Test assoc array for everything ```zsh % __antidote_parser 'foo/bar branch:baz kind:zsh path:plugins/baz pre:precmd post:"post cmd"' | print_aarr $assoc_arr : bundle _repo : foo/bar _repodir : foo/bar _type : repo _url : https://fakegitsite.com/foo/bar branch : baz kind : zsh name : foo/bar path : plugins/baz post : post cmd pre : precmd % ``` ## Test specific keys have known values Test name: ```zsh % __antidote_parser 'foo/bar' | aarr_val name foo/bar % ``` Test \_type: ```zsh % __antidote_parser 'foo/bar' | aarr_val _type repo % __antidote_parser 'https://github.com/foo/bar' | aarr_val _type url % __antidote_parser 'git@bitbucket.org:foo/bar' | aarr_val _type url % __antidote_parser '$foo/bar' | aarr_val _type path % __antidote_parser '$foo/bar/baz.zsh' | aarr_val _type path % __antidote_parser '~foo/bar' | aarr_val _type path % __antidote_parser '~/foo' | aarr_val _type path % __antidote_parser './foo.zsh' | aarr_val _type path % __antidote_parser '../foo.zsh' | aarr_val _type path % __antidote_parser 'foo/bar/' | aarr_val _type path % __antidote_parser 'foo:bar' | aarr_val _type ? % __antidote_parser 'bad@gitsite.com/foo/bar' | aarr_val _type ? % __antidote_parser 'http:/badsite.com/foo/bar' | aarr_val _type ? % __antidote_parser 'https://badsite.com/foo/bar/baz' | aarr_val _type ? % __antidote_parser 'https://badsite.com/foo' | aarr_val _type ? % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_real.md000066400000000000000000000125301500640522100170530ustar00rootroot00000000000000# antidote tests for real ## antidote bundle ### Setup ```zsh % TESTDATA=$T_PRJDIR/tests/testdata/real % source ./tests/__init__.zsh % # do it for real! % t_setup_real % ``` ### Config ```zsh % zstyle ':antidote:bundle:*' zcompile 'yes' % ``` ### Bundle Clone and generate bundle script ```zsh % antidote bundle <$T_TESTDATA/.zsh_plugins.txt >$ZDOTDIR/.zsh_plugins.zsh 2>/dev/null % cat $ZDOTDIR/.zsh_plugins.zsh | subenv ANTIDOTE_HOME #=> --file testdata/real/.zsh_plugins.zsh % ``` Check to see that everything cloned ```zsh % antidote list | subenv ANTIDOTE_HOME #=> --file testdata/real/repo-list.txt % ``` Test that everything compiled ```zsh % zwcfiles=($(ls $(antidote home)/**/*.zwc(N) | wc -l)) % test $zwcfiles -gt 100 #=> --exit 0 % ``` Test that everything updated ```zsh % rm -rf -- $(antidote home)/**/*.zwc(N) % antidote update &>/dev/null % zwcfiles=($(ls $(antidote home)/**/*.zwc(N) | wc -l)) % test $zwcfiles -gt 100 #=> --exit 0 % ``` Check to see that branch:br annotations properly changed the cloned branch ```zsh % branched_plugin="$ANTIDOTE_HOME/mattmc3/antidote" % git -C $branched_plugin branch --show-current 2>/dev/null pz % ``` Test that `antidote purge --all` aborts when told "no". ```zsh % function test_exists { [[ -e "$1" ]] } % zstyle ':antidote:purge:all' answer 'n' % antidote purge --all #=> --exit 1 % antidote list | subenv ANTIDOTE_HOME #=> --file testdata/real/repo-list.txt % antidote list | wc -l | awk '{print $1}' 15 % test_exists $ZDOTDIR/.zsh_plugins.zsh(.N) #=> --exit 0 % test_exists $ZDOTDIR/.zsh_plugins*.bak(.N) #=> --exit 1 % ``` Test that `antidote purge --all` does the work when told "yes". ```zsh % function test_exists { [[ -e "$1" ]] } % zstyle ':antidote:purge:all' answer 'y' % antidote purge --all | tail -n 1 #=> --exit 0 Antidote purge complete. Be sure to start a new Zsh session. % antidote list | wc -l | awk '{print $1}' 0 % test_exists $ZDOTDIR/.zsh_plugins.zsh(.N) #=> --exit 1 % test_exists $ZDOTDIR/.zsh_plugins*.bak(.N) #=> --exit 0 % ``` ### Teardown ```zsh % zstyle -d ':antidote:purge:all' answer % t_teardown % ``` ## CRLF testing ### Redo setup ```zsh % TESTDATA=$PWD/tests/testdata/real % source ./tests/__init__.zsh % t_setup_real % ``` Clone and generate bundle script ```zsh % antidote bundle <$T_TESTDATA/.zsh_plugins.crlf.txt >$ZDOTDIR/.zsh_plugins.zsh 2>/dev/null % cat $ZDOTDIR/.zsh_plugins.zsh | subenv ANTIDOTE_HOME 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" % ``` Check to see that everything cloned ```zsh % antidote list | subenv ANTIDOTE_HOME 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 % ``` ### Teardown ```zsh % t_teardown % ``` ## antidote load ### Redo setup ```zsh % T_TESTDATA=$T_PRJDIR/tests/testdata/real % source ./tests/__init__.zsh % t_setup_real % ``` ### Load Load rupa/z ```zsh % echo "rupa/z" > $ZDOTDIR/.zsh_plugins.txt % antidote load 2>&1 # antidote cloning rupa/z... % echo $+aliases[z] 1 % wc -l <$ZDOTDIR/.zsh_plugins.zsh | sed 's/ //g' 2 % (( ! $+aliases[z] )) || unalias z % ``` Load re-generates .zsh_plugins.zsh when .zsh_plugins.txt changes ```zsh % compdir=$ANTIDOTE_HOME/zsh-users/zsh-completions/src % (( $fpath[(Ie)$compdir] )) || echo "completions are not in fpath" completions are not in fpath % echo $+aliases[z] 0 % ``` ...add a new plugin ```zsh % wc -l <$ZDOTDIR/.zsh_plugins.txt | sed 's/ //g' 1 % cat $ZDOTDIR/.zsh_plugins.zsh | subenv ANTIDOTE_HOME fpath+=( "$ANTIDOTE_HOME/rupa/z" ) source "$ANTIDOTE_HOME/rupa/z/z.sh" % echo "zsh-users/zsh-completions path:src kind:fpath" >> $ZDOTDIR/.zsh_plugins.txt % # static cache file hasn't changed yet % cat $ZDOTDIR/.zsh_plugins.zsh | subenv ANTIDOTE_HOME fpath+=( "$ANTIDOTE_HOME/rupa/z" ) source "$ANTIDOTE_HOME/rupa/z/z.sh" % ``` ...now do `antidote load` and show that it actually loaded all plugins ```zsh % antidote load 2>&1 # antidote cloning zsh-users/zsh-completions... % cat $ZDOTDIR/.zsh_plugins.zsh | subenv ANTIDOTE_HOME fpath+=( "$ANTIDOTE_HOME/rupa/z" ) source "$ANTIDOTE_HOME/rupa/z/z.sh" fpath+=( "$ANTIDOTE_HOME/zsh-users/zsh-completions/src" ) % echo $+aliases[z] 1 % (( $fpath[(Ie)$compdir] )) && echo "completions are in fpath" completions are in fpath % % wc -l <$ZDOTDIR/.zsh_plugins.zsh | sed 's/ //g' 3 % ``` ### Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_setopts_special.md000066400000000000000000000013011500640522100213230ustar00rootroot00000000000000# antidote handles special Zsh options ## Setup Tests to handle special Zsh options. [#154](https://github.com/mattmc3/antidote/issues/154). ```zsh % source ./tests/__init__.zsh % t_setup % setopt KSH_ARRAYS SH_GLOB % ``` # Ensure bundle works ```zsh % antidote bundle <$ZDOTDIR/.zsh_plugins.txt >$ZDOTDIR/.zsh_plugins.zsh % cat $ZDOTDIR/.zsh_plugins.zsh | subenv #=> --file testdata/.zsh_plugins.zsh % ``` # Ensure options remained ```zsh % [[ -o KSH_ARRAYS ]] && echo KSH_ARRAYS KSH_ARRAYS % [[ -o SH_GLOB ]] && echo SH_GLOB SH_GLOB % # unset % unsetopt KSH_ARRAYS SH_GLOB % [[ -o KSH_ARRAYS ]] && echo KSH_ARRAYS % [[ -o SH_GLOB ]] && echo SH_GLOB % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_zcompile_bundle.md000066400000000000000000000030141500640522100213000ustar00rootroot00000000000000# antidote load tests ## Setup ```zsh % source ./tests/__init__.zsh % t_setup % ``` ### General 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 ZDOTDIR source "$ZDOTDIR/custom/lib/lib1.zsh" % ! test -e $ZDOTDIR/custom/lib/lib1.zsh.zwc #=> --exit 0 % 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 % ``` 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 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 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 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 % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_zcompile_static.md000066400000000000000000000020671500640522100213250ustar00rootroot00000000000000# antidote load tests ## Setup ```zsh % source ./tests/__init__.zsh % t_setup % ``` ### General Ensure a compiled file exists: ```zsh % zstyle ':antidote:static' zcompile 'yes' % zstyle ':antidote:static' file $ZDOTDIR/.zplugins_fake_zcompile_static.zsh % ! test -e $ZDOTDIR/.zplugins_fake_zcompile_static.zsh.zwc #=> --exit 0 % antidote load $ZDOTDIR/.zplugins_fake_load >/dev/null % cat $ZDOTDIR/.zplugins_fake_zcompile_static.zsh | subenv #=> --file testdata/.zplugins_fake_zcompile_static.zsh % test -e $ZDOTDIR/.zplugins_fake_zcompile_static.zsh.zwc #=> --exit 0 % t_reset % ``` Ensure a compiled file does not exist: ```zsh % zstyle ':antidote:static' zcompile 'no' % zstyle ':antidote:static' file $ZDOTDIR/.zplugins_fake_load.zsh % ! test -e $ZDOTDIR/.zplugins_fake_load.zsh.zwc #=> --exit 0 % antidote load $ZDOTDIR/.zplugins_fake_load >/dev/null % cat $ZDOTDIR/.zplugins_fake_load.zsh | subenv #=> --file testdata/.zplugins_fake_load.zsh % ! test -e $ZDOTDIR/.zplugins_fake_load.zsh.zwc #=> --exit 0 % t_reset % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.10/tests/test_zsetopts.md000066400000000000000000000036471500640522100200340ustar00rootroot00000000000000# antidote respects setopts ## Setup ```zsh % source ./tests/__init__.zsh % t_setup % ``` Set up a plugin that changes Zsh options ```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 "lampoon/xmas" >$ZDOTDIR/.zsh_plugins.txt % ``` ## Test that plugins that run setopts work Verify initial state ```zsh % setopt noaliases % set -o | grep noaliases noaliases on % set -o | grep autocd autocd off % ``` Load the plugins and see if the option took ```zsh % antidote load &>/dev/null #=> --exit 0 % set -o | grep noaliases noaliases off % set -o | grep autocd autocd on % # cleanup % setopt noaliases no_autocd % ``` Tests to ensure [#86](https://github.com/mattmc3/antidote/issues/86) stays fixed. Check that stderr is empty. ```zsh % setopt posix_identifiers % antidote -v 3>&1 2>&3 >/dev/null #=> --exit 0 % antidote -h 3>&1 2>&3 >/dev/null #=> --exit 0 % antidote help 3>&1 2>&3 >/dev/null #=> --exit 0 % # cleanup % unsetopt posix_identifiers % ``` ## Clark Grizwold lighting ceremony!

via GIPHY

```zsh % optcnt=$(setopt | wc -l | tr -d ' ') % echo $optcnt #=> --regex ^\d+$ % test $optcnt -lt 10 && echo "less than 10 enabled zsh opts" less than 10 enabled zsh opts % # now lets turn on all the lights % echo '$ZDOTDIR/custom/plugins/grizwold' >$ZDOTDIR/.zsh_plugins.txt % antidote load % optcnt=$(setopt | wc -l | tr -d ' ') % test $optcnt -gt 150 && echo "zillions of enabled zsh options (>150)" zillions of enabled zsh options (>150) % ``` ## Teardown ```zsh % unsetopt $grizwold_zopts % t_teardown % ``` antidote-1.9.10/tests/testdata/000077500000000000000000000000001500640522100163575ustar00rootroot00000000000000antidote-1.9.10/tests/testdata/.zplugins_fake_load.zsh000066400000000000000000000026071500640522100230300ustar00rootroot00000000000000fpath+=( "$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+=( "$HOME/.cache/antidote/getantidote/zsh-defer" ) source "$HOME/.cache/antidote/getantidote/zsh-defer/zsh-defer.plugin.zsh" fi 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" antidote-1.9.10/tests/testdata/.zplugins_fake_zcompile_static.zsh000066400000000000000000000031731500640522100253010ustar00rootroot00000000000000function { 0=${(%):-%x} local staticfile=${0:A} [[ -e ${staticfile} ]] || return 1 if [[ ! -s ${staticfile}.zwc || ${staticfile} -nt ${staticfile}.zwc ]]; then builtin autoload -Uz zrecompile zrecompile -pq ${staticfile} fi } 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+=( "$HOME/.cache/antidote/getantidote/zsh-defer" ) source "$HOME/.cache/antidote/getantidote/zsh-defer/zsh-defer.plugin.zsh" fi 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" antidote-1.9.10/tests/testdata/.zsh_plugins.zsh000066400000000000000000000024321500640522100215310ustar00rootroot00000000000000fpath+=( "$HOME/foo/bar" ) source "$HOME/foo/bar/bar.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+=( "$HOME/.cache/antidote/getantidote/zsh-defer" ) source "$HOME/.cache/antidote/getantidote/zsh-defer/zsh-defer.plugin.zsh" fi 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" antidote-1.9.10/tests/testdata/.zsh_plugins_empty.txt000066400000000000000000000000321500640522100227540ustar00rootroot00000000000000# comments # nothing here antidote-1.9.10/tests/testdata/.zsh_plugins_multi_defer.zsh000066400000000000000000000054501500640522100241130ustar00rootroot00000000000000fpath+=( "$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-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" 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" fi if ! (( $+functions[zsh-defer] )); then 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-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" 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" antidote-1.9.10/tests/testdata/.zsh_plugins_no_defer.zsh000066400000000000000000000037701500640522100234000ustar00rootroot00000000000000fpath+=( "$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-syntax-highlighting" ) source "$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh" 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" fi 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-zdharma-continuum-SLASH-fast-syntax-highlighting" ) 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" antidote-1.9.10/tests/testdata/.zsh_plugins_purged.txt000066400000000000000000000007501500640522100231130ustar00rootroot00000000000000# local plugins ~/foo/bar $ZSH_CUSTOM path:plugins/myplugin # 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 # deferred ohmy/ohmy path:plugins/magic-enter kind:defer # theme ohmy/ohmy path:custom/themes/pretty.zsh-theme antidote-1.9.10/tests/testdata/.zsh_plugins_repos.txt000066400000000000000000000007201500640522100227520ustar00rootroot00000000000000# comments user/repo # blank lines # regular repos https://github.com/user/repo http://github.com/user/repo.git https://github.com/user/repo git@github.com:user/repo # annotations bar/baz path:plugins/qux bar/baz path:themes/qux.zsh-theme # branch foobar/foobar branch:baz # defer https://github.com/foo/qux kind:defer https://github.com/foo/baz kind:defer # non repos foo ~/.zplugins/bar $ZDOTDIR/plugins/bar # dupes user/repo https://github.com/user/repo antidote-1.9.10/tests/testdata/antibody/000077500000000000000000000000001500640522100201705ustar00rootroot00000000000000antidote-1.9.10/tests/testdata/antibody/script-foobar.zsh000066400000000000000000000002651500640522100234730ustar00rootroot00000000000000fpath+=( "$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" antidote-1.9.10/tests/testdata/antibody/script-fooqux.zsh000066400000000000000000000002171500640522100235410ustar00rootroot00000000000000fpath+=( "$ANTIDOTE_HOME/git-AT-github.com-COLON-foo-SLASH-qux" ) source "$ANTIDOTE_HOME/git-AT-github.com-COLON-foo-SLASH-qux/qux.plugin.zsh" antidote-1.9.10/tests/testdata/real/000077500000000000000000000000001500640522100173025ustar00rootroot00000000000000antidote-1.9.10/tests/testdata/real/.zsh_plugins.crlf.txt000066400000000000000000000002321500640522100234100ustar00rootroot00000000000000# CRLF file rupa/z zsh-users/zsh-syntax-highlighting zsh-users/zsh-completions zsh-users/zsh-autosuggestions zsh-users/zsh-history-substring-search antidote-1.9.10/tests/testdata/real/.zsh_plugins.txt000066400000000000000000000020461500640522100224700ustar00rootroot00000000000000# paths #$ZDOTDIR/aliases.zsh $ZSH_CUSTOM/plugins/myplugin # plugins zsh-users/zsh-history-substring-search https://github.com/zsh-users/zsh-autosuggestions # git@ repo URLs aren't good for CI... revisit # git@github.com:zsh-users/zsh-completions.git # kind:zsh zsh-users/zsh-syntax-highlighting kind:zsh # kind:clone zsh-users/antigen kind:clone # kind:fpath sindresorhus/pure kind:fpath # kind:path romkatv/zsh-bench kind:path # kind:autoload mattmc3/zman path:functions kind:autoload # fpath-rule ohmyzsh/ohmyzsh path:plugins/gradle fpath-rule:prepend ohmyzsh/ohmyzsh path:plugins/docker fpath-rule:append # conditional ohmyzsh/ohmyzsh path:plugins/macos conditional:is-macos # branches mattmc3/antidote branch:pz # subpath plugins ohmyzsh/ohmyzsh path:lib/clipboard.zsh ohmyzsh/ohmyzsh path:plugins/extract ohmyzsh/ohmyzsh path:plugins/magic-enter ohmyzsh/ohmyzsh path:plugins/fancy-ctrl-z # deferred zdharma-continuum/fast-syntax-highlighting kind:defer # theme dracula/zsh # non-conforming plugins peterhurford/up.zsh rummik/zsh-tailf rupa/z antidote-1.9.10/tests/testdata/real/.zsh_plugins.zsh000066400000000000000000000046661500640522100224670ustar00rootroot00000000000000fpath+=( "$ZSH_CUSTOM/plugins/myplugin" ) source "$ZSH_CUSTOM/plugins/myplugin/myplugin.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" 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/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/ohmyzsh/ohmyzsh/plugins/macos" ) source "$ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/macos/macos.plugin.zsh" fi 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/romkatv/zsh-defer" ) source "$ANTIDOTE_HOME/romkatv/zsh-defer/zsh-defer.plugin.zsh" fi 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" antidote-1.9.10/tests/testdata/real/repo-list.txt000066400000000000000000000027601500640522100217660ustar00rootroot00000000000000https://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 antidote-1.9.10/tests/testdata/script-foobar.zsh000066400000000000000000000001231500640522100216530ustar00rootroot00000000000000fpath+=( "$ANTIDOTE_HOME/foo/bar" ) source "$ANTIDOTE_HOME/foo/bar/bar.plugin.zsh" antidote-1.9.10/tests/testdata/script-fooqux.zsh000066400000000000000000000001231500640522100217240ustar00rootroot00000000000000fpath+=( "$ANTIDOTE_HOME/foo/qux" ) source "$ANTIDOTE_HOME/foo/qux/qux.plugin.zsh" antidote-1.9.10/tests/tmp_home/000077500000000000000000000000001500640522100163565ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/000077500000000000000000000000001500640522100174775ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/000077500000000000000000000000001500640522100213105ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-qux/000077500000000000000000000000001500640522100275465ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-qux/.mockgit/000077500000000000000000000000001500640522100312615ustar00rootroot00000000000000.gitkeep000066400000000000000000000000001500640522100326210ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-qux/.mockgitantidote-1.9.10/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-qux/qux.plugin.zsh000066400000000000000000000000661500640522100324100ustar00rootroot00000000000000echo "sourcing foo/qux..." plugins=($plugins foo/qux) https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/000077500000000000000000000000001500640522100322155ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody.mockgit/000077500000000000000000000000001500640522100337305ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar.gitkeep000066400000000000000000000000001500640522100353470ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/.mockgitbar.plugin.zsh000066400000000000000000000000661500640522100350060ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-barecho "sourcing foo/bar..." plugins=($plugins foo/bar) https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz/000077500000000000000000000000001500640522100322255ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody.mockgit/000077500000000000000000000000001500640522100337405ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz.gitkeep000066400000000000000000000000001500640522100353570ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz/.mockgitbaz.plugin.zsh000066400000000000000000000000661500640522100350260ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bazecho "sourcing foo/baz..." plugins=($plugins foo/baz) functions/000077500000000000000000000000001500640522100342355ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz_baz000066400000000000000000000000401500640522100350650ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz/functions#!/bin/zsh echo _baz completion baz000066400000000000000000000000711500640522100347320ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz/functions#!/bin/zsh function baz { echo baz function } baz "$@" https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer/000077500000000000000000000000001500640522100350645ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody.mockgit/000077500000000000000000000000001500640522100365775ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer.gitkeep000066400000000000000000000000001500640522100402160ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer/.mockgitzsh-defer.plugin.zsh000066400000000000000000000001751500640522100410010ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer# fake foo/bar echo "sourcing getantidote/zsh-defer..." plugins=($plugins getantidote/zsh-defer) function zsh-defer { $@ } https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/000077500000000000000000000000001500640522100326165ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody.mockgit/000077500000000000000000000000001500640522100343315ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy.gitkeep000066400000000000000000000000001500640522100357500ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/.mockgitcustom/000077500000000000000000000000001500640522100341305ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmythemes/000077500000000000000000000000001500640522100354155ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/custompretty.zsh-theme000066400000000000000000000001011500640522100405620ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/custom/themesecho "sourcing pretty.zsh-theme..." themes=($themes ohmy:pretty) ugly.zsh-theme000066400000000000000000000000751500640522100402250ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/custom/themesecho "sourcing ugly.zsh-theme..." themes=($themes ohmy:ugly) lib/000077500000000000000000000000001500640522100333645ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmylib1.zsh000066400000000000000000000000741500640522100347420ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/libecho "sourcing ohmy/lib/lib1.zsh..." libs=($libs ohmy:lib1) lib2.zsh000066400000000000000000000000741500640522100347430ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/libecho "sourcing ohmy/lib/lib2.zsh..." libs=($libs ohmy:lib2) lib3.zsh000066400000000000000000000000741500640522100347440ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/libecho "sourcing ohmy/lib/lib3.zsh..." libs=($libs ohmy:lib2) oh-my.sh000066400000000000000000000000711500640522100342010ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmyecho "sourcing oh-my.sh..." plugins=($plugins ohmy/ohmy) plugins/000077500000000000000000000000001500640522100342775ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmydocker/000077500000000000000000000000001500640522100355465ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins_docker000066400000000000000000000000111500640522100370670ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker#compdef docker.plugin.zsh000066400000000000000000000000741500640522100410410ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/dockerecho "sourcing docker.plugin.zsh..." plugins+=(ohmy:docker) extract/000077500000000000000000000000001500640522100357515ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/pluginsextract.plugin.zsh000066400000000000000000000000761500640522100414510ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/extractecho "sourcing extract.plugin.zsh..." plugins+=(ohmy:extract) macos/000077500000000000000000000000001500640522100354015ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/pluginsfunctions/000077500000000000000000000000001500640522100374115ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macosmacos_func000066400000000000000000000001121500640522100414430ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos/functions#!/bin/zsh function macos_func { echo macos_func "$@" } macos_func "$@" macos.plugin.zsh000066400000000000000000000000721500640522100405250ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macosecho "sourcing macos.plugin.zsh..." plugins+=(ohmy:macos) magic-enter/000077500000000000000000000000001500640522100364725ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/pluginsmagic-enter.plugin.zsh000066400000000000000000000001061500640522100427050ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/magic-enterecho "sourcing magic-enter.plugin.zsh..." plugins+=(ohmy:magic-enter) themes/000077500000000000000000000000001500640522100341035ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmypretty.zsh-theme000066400000000000000000000001011500640522100372500ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/themesecho "sourcing pretty.zsh-theme..." themes=($themes ohmy:pretty) antidote-1.9.10/tests/tmp_home/.cache/antidote/000077500000000000000000000000001500640522100213065ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/foo/000077500000000000000000000000001500640522100220715ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/foo/bar/000077500000000000000000000000001500640522100226355ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/foo/bar/.mockgit/000077500000000000000000000000001500640522100243505ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/foo/bar/.mockgit/config/000077500000000000000000000000001500640522100256155ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/foo/bar/.mockgit/config/remote.origin.url000066400000000000000000000000331500640522100311160ustar00rootroot00000000000000https://github.com/foo/bar antidote-1.9.10/tests/tmp_home/.cache/antidote/foo/bar/bar.plugin.zsh000066400000000000000000000000661500640522100254260ustar00rootroot00000000000000echo "sourcing foo/bar..." plugins=($plugins foo/bar) antidote-1.9.10/tests/tmp_home/.cache/antidote/foo/baz/000077500000000000000000000000001500640522100226455ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/foo/baz/.mockgit/000077500000000000000000000000001500640522100243605ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/foo/baz/.mockgit/config/000077500000000000000000000000001500640522100256255ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/foo/baz/.mockgit/config/remote.origin.url000066400000000000000000000000331500640522100311260ustar00rootroot00000000000000https://github.com/foo/baz antidote-1.9.10/tests/tmp_home/.cache/antidote/foo/baz/baz.plugin.zsh000066400000000000000000000000661500640522100254460ustar00rootroot00000000000000echo "sourcing foo/baz..." plugins=($plugins foo/baz) antidote-1.9.10/tests/tmp_home/.cache/antidote/foo/baz/functions/000077500000000000000000000000001500640522100246555ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/foo/baz/functions/_baz000066400000000000000000000000401500640522100255050ustar00rootroot00000000000000#!/bin/zsh echo _baz completion antidote-1.9.10/tests/tmp_home/.cache/antidote/foo/baz/functions/baz000066400000000000000000000000711500640522100253520ustar00rootroot00000000000000#!/bin/zsh function baz { echo baz function } baz "$@" antidote-1.9.10/tests/tmp_home/.cache/antidote/foo/qux/000077500000000000000000000000001500640522100227065ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/foo/qux/.mockgit/000077500000000000000000000000001500640522100244215ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/foo/qux/.mockgit/config/000077500000000000000000000000001500640522100256665ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/foo/qux/.mockgit/config/remote.origin.url000066400000000000000000000000271500640522100311720ustar00rootroot00000000000000git@github.com:foo/qux antidote-1.9.10/tests/tmp_home/.cache/antidote/foo/qux/qux.plugin.zsh000066400000000000000000000000661500640522100255500ustar00rootroot00000000000000echo "sourcing foo/qux..." plugins=($plugins foo/qux) antidote-1.9.10/tests/tmp_home/.cache/antidote/getantidote/000077500000000000000000000000001500640522100236155ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/getantidote/zsh-defer/000077500000000000000000000000001500640522100255045ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/getantidote/zsh-defer/.mockgit/000077500000000000000000000000001500640522100272175ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/getantidote/zsh-defer/.mockgit/config/000077500000000000000000000000001500640522100304645ustar00rootroot00000000000000remote.origin.url000066400000000000000000000000511500640522100337060ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/getantidote/zsh-defer/.mockgit/confighttps://github.com/getantidote/zsh-defer antidote-1.9.10/tests/tmp_home/.cache/antidote/getantidote/zsh-defer/zsh-defer.plugin.zsh000066400000000000000000000001751500640522100314210ustar00rootroot00000000000000# fake foo/bar echo "sourcing getantidote/zsh-defer..." plugins=($plugins getantidote/zsh-defer) function zsh-defer { $@ } antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/000077500000000000000000000000001500640522100222625ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/000077500000000000000000000000001500640522100232365ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/.mockgit/000077500000000000000000000000001500640522100247515ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/.mockgit/config/000077500000000000000000000000001500640522100262165ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/.mockgit/config/remote.origin.url000066400000000000000000000000351500640522100315210ustar00rootroot00000000000000https://github.com/ohmy/ohmy antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/custom/000077500000000000000000000000001500640522100245505ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/custom/themes/000077500000000000000000000000001500640522100260355ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/custom/themes/pretty.zsh-theme000066400000000000000000000001011500640522100312020ustar00rootroot00000000000000echo "sourcing pretty.zsh-theme..." themes=($themes ohmy:pretty) antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/custom/themes/ugly.zsh-theme000066400000000000000000000000751500640522100306450ustar00rootroot00000000000000echo "sourcing ugly.zsh-theme..." themes=($themes ohmy:ugly) antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/lib/000077500000000000000000000000001500640522100240045ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/lib/lib1.zsh000066400000000000000000000000741500640522100253620ustar00rootroot00000000000000echo "sourcing ohmy/lib/lib1.zsh..." libs=($libs ohmy:lib1) antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/lib/lib2.zsh000066400000000000000000000000741500640522100253630ustar00rootroot00000000000000echo "sourcing ohmy/lib/lib2.zsh..." libs=($libs ohmy:lib2) antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/lib/lib3.zsh000066400000000000000000000000741500640522100253640ustar00rootroot00000000000000echo "sourcing ohmy/lib/lib3.zsh..." libs=($libs ohmy:lib2) antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/oh-my.sh000066400000000000000000000000711500640522100246210ustar00rootroot00000000000000echo "sourcing oh-my.sh..." plugins=($plugins ohmy/ohmy) antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/000077500000000000000000000000001500640522100247175ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/docker/000077500000000000000000000000001500640522100261665ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/docker/_docker000066400000000000000000000000111500640522100275070ustar00rootroot00000000000000#compdef antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/docker/docker.plugin.zsh000066400000000000000000000000741500640522100314610ustar00rootroot00000000000000echo "sourcing docker.plugin.zsh..." plugins+=(ohmy:docker) antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/extract/000077500000000000000000000000001500640522100263715ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/extract/extract.plugin.zsh000066400000000000000000000000761500640522100320710ustar00rootroot00000000000000echo "sourcing extract.plugin.zsh..." plugins+=(ohmy:extract) antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/macos/000077500000000000000000000000001500640522100260215ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/macos/functions/000077500000000000000000000000001500640522100300315ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/macos/functions/macos_func000066400000000000000000000001121500640522100320630ustar00rootroot00000000000000#!/bin/zsh function macos_func { echo macos_func "$@" } macos_func "$@" antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/macos/macos.plugin.zsh000066400000000000000000000000721500640522100311450ustar00rootroot00000000000000echo "sourcing macos.plugin.zsh..." plugins+=(ohmy:macos) antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/magic-enter/000077500000000000000000000000001500640522100271125ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/magic-enter/magic-enter.plugin.zsh000066400000000000000000000001061500640522100333250ustar00rootroot00000000000000echo "sourcing magic-enter.plugin.zsh..." plugins+=(ohmy:magic-enter) antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/themes/000077500000000000000000000000001500640522100245235ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.cache/antidote/ohmy/ohmy/themes/pretty.zsh-theme000066400000000000000000000001011500640522100276700ustar00rootroot00000000000000echo "sourcing pretty.zsh-theme..." themes=($themes ohmy:pretty) antidote-1.9.10/tests/tmp_home/.zsh/000077500000000000000000000000001500640522100172405ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.zsh/.zplugins_fake_load000066400000000000000000000010221500640522100230740ustar00rootroot00000000000000# 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 antidote-1.9.10/tests/tmp_home/.zsh/.zsh_plugins.txt000066400000000000000000000007401500640522100224250ustar00rootroot00000000000000# local plugins ~/foo/bar $ZSH_CUSTOM path:plugins/myplugin # 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 # deferred ohmy/ohmy path:plugins/magic-enter kind:defer # theme ohmy/ohmy path:custom/themes/pretty.zsh-theme antidote-1.9.10/tests/tmp_home/.zsh/aliases.zsh000066400000000000000000000000371500640522100214070ustar00rootroot00000000000000echo "sourcing aliases.zsh..." antidote-1.9.10/tests/tmp_home/.zsh/custom/000077500000000000000000000000001500640522100205525ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.zsh/custom/lib/000077500000000000000000000000001500640522100213205ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.zsh/custom/lib/lib1.zsh000066400000000000000000000000741500640522100226760ustar00rootroot00000000000000echo "sourcing custom lib1.zsh..." libs=($libs custom:lib1) antidote-1.9.10/tests/tmp_home/.zsh/custom/lib/lib2.zsh000066400000000000000000000000741500640522100226770ustar00rootroot00000000000000echo "sourcing custom lib2.zsh..." libs=($libs custom:lib2) antidote-1.9.10/tests/tmp_home/.zsh/custom/plugins/000077500000000000000000000000001500640522100222335ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.zsh/custom/plugins/grizwold/000077500000000000000000000000001500640522100240745ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.zsh/custom/plugins/grizwold/grizwold.plugin.zsh000066400000000000000000000061531500640522100277650ustar00rootroot00000000000000() { 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 # Not available in Zsh 5.4.2 chasedots chaselinks nocheckjobs # nocheckrunningjobs # Not available in Zsh 5.4.2 # 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 } antidote-1.9.10/tests/tmp_home/.zsh/custom/plugins/myplugin/000077500000000000000000000000001500640522100240775ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.zsh/custom/plugins/myplugin/myplugin.plugin.zsh000066400000000000000000000001061500640522100277630ustar00rootroot00000000000000# fake foo/bar echo "sourcing myplugin..." plugins+=(custom:myplugin) antidote-1.9.10/tests/tmp_home/.zsh/custom/plugins/mytheme/000077500000000000000000000000001500640522100237035ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.zsh/custom/plugins/mytheme/mytheme.zsh-theme000066400000000000000000000000651500640522100272020ustar00rootroot00000000000000echo "sourcing mytheme..." plugins+=(custom:mytheme) antidote-1.9.10/tests/tmp_home/.zsh/functions/000077500000000000000000000000001500640522100212505ustar00rootroot00000000000000antidote-1.9.10/tests/tmp_home/.zsh/functions/myfunc000066400000000000000000000000761500640522100224770ustar00rootroot00000000000000#!/bin/zsh function myfunc { echo myfunc "$@" } myfunc "$@" antidote-1.9.10/tools/000077500000000000000000000000001500640522100145445ustar00rootroot00000000000000antidote-1.9.10/tools/buildman000077500000000000000000000020651500640522100162700ustar00rootroot00000000000000#!/usr/bin/env zsh # https://pandoc.org/demo/pandoc.1.md # https://eddieantonio.ca/blog/2015/12/18/authoring-manpages-in-markdown-with-pandoc/ # https://jeromebelleman.gitlab.io/posts/publishing/manpages/ 0=${(%):-%x} BASEDIR=${0:a:h:h} TMPDIR=$BASEDIR/.tmp/buildman [[ -d $TMPDIR ]] && command rm -rf $TMPDIR mkdir -p $TMPDIR sedi() { sed --version &> /dev/null && sed -i -- "$@" || sed -i "" "$@" } for manpage in $BASEDIR/man/*.md; do case ${manpage:t:r} in footer|example) continue ;; esac print "Building ${manpage:t:r} manpage..." [[ -d $BASEDIR/man/man1 ]] || mkdir -p $BASEDIR/man/man1 mdfile=$TMPDIR/${manpage:t}.md cat ${manpage} > $mdfile print "" >> $mdfile cat $BASEDIR/man/footer.md >> $mdfile 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 antidote-1.9.10/tools/bumpver000077500000000000000000000004321500640522100161510ustar00rootroot00000000000000#!/usr/bin/env zsh 0=${(%):-%x} bumpversion --allow-dirty ${1:-revision} newver=$(grep 'current_version' ${0:h:h}/.bumpversion.cfg | sed -E 's/^[^0-9]+(.*)$/\1/') print "Version bumped to $newver." print "Now run:" print " git commit -am 'Bump version to $newver'" | tee >(pbcopy) antidote-1.9.10/tools/run-clitests000077500000000000000000000020701500640522100171250ustar00rootroot00000000000000#!/usr/bin/env zsh 0=${(%):-%x} setopt extended_glob local T_PRJDIR="${0:A:h:h}" cd "$T_PRJDIR" local o_unit o_rev zparseopts -D -M -- -unit=o_unit -rev=o_rev || return 1 testfiles=() if (( $# > 0 )); then testfiles=($@) elif (( $#o_unit )); then testfiles=($T_PRJDIR/tests/README.md $T_PRJDIR/tests/test_*.md~*test_real*~*foo*) else testfiles=($T_PRJDIR/tests/README.md $T_PRJDIR/tests/test_*.md) fi # if tests are run in reverse order, I can catch places where I didn't teardown properly if (( $#o_rev )); then testfiles=(${(O)testfiles}) fi # foo example test command # env -i PATH=$PATH FPATH=$FPATH \ # zsh -f -- =clitest --list-run --progress dot --prompt '%' --color always $T_PRJDIR/tests/foo.md # Use ZSH_BINARY if set, otherwise fallback to default zsh ZSH=${ZSH_BINARY:-zsh} env -i PATH=$PATH FPATH=$FPATH PAGER=cat \ $ZSH -f -- \ =clitest \ --list-run --progress dot --prompt '%' \ --color always \ --pre-flight 'git --version; print $T_PRJDIR $VENDOR $OSTYPE =$ZSH $ZSH_VERSION $ZSH_PATCHLEVEL' \ -- $testfiles antidote-1.9.10/tools/sloc000077500000000000000000000005111500640522100154270ustar00rootroot00000000000000#!/usr/bin/env zsh 0=${(%):-%x} BASEDIR=${0:h:h} cd $BASEDIR print "loc:" wc -l antidote.zsh ./functions/*(.) print "sloc:" for file in antidote.zsh ./functions/*(.); do lines=$(awk '/^ *[^#]+$/{print}' $file | wc -l) print $lines $file done print "sloc total:" awk '/^ *[^#]+$/{print}' antidote.zsh ./functions/*(.) | wc -l