Skip to content

Change antidote default path #7

@IronicUsername

Description

@IronicUsername

Goal
Have the path to antidote be flexible.

Context
When setting up a fresh instance of InstantOS i noticed that by default, the path to antidote was always searched under $zshhome/.antibody

Since antidote devs officially tell ppl you can either install it by pulling git into ${ZDOTDIR:-$HOME}/.antidote
OR
install via a package manager which in turn installs antidote in a different path.

so basically here

instantSHELL/zshrc

Lines 34 to 57 in c1d559a

install_antidote_plugins() {
echo "loading plugin bundle"
[ -e "$HOME/.cache/zsh" ] || mkdir -p "$HOME/.cache/zsh"
BUNDLEFILE="${BUNDLEFILE:-/usr/share/instantshell/bundle.txt}"
# clone antidote if necessary and generate a static plugin file
cloneantidote() {
ANTIDOTEURL=/usr/share/instantshell/antidote
[ -e "$ANTIDOTEURL" ] || ANTIDOTEURL=https://github.com/mattmc3/antidote.git
git clone --depth=1 "$ANTIDOTEURL" $zhome/.antidote
}
if [[ ! $zhome/.zsh_plugins.zsh -nt $zhome/.zsh_plugins.txt ]]; then
[[ -e $zhome/.antidote ]] || cloneantidote
[[ -e $zhome/.zsh_plugins.txt ]] || touch $zhome/.zsh_plugins.txt
(
source $zhome/.antidote/antidote.zsh
BUNDLESTUFF=$(cat "$BUNDLEFILE")
if ! isinstantos
then
BUNDLESTUFF="$(grep -v instantos <<<"$BUNDLESTUFF")"
fi
antidote bundle <<<"$BUNDLESTUFF" >$zhome/.zsh_plugins.zsh
)
fi
}

Tasks

  • the .zshrc should:
    • check if antidote is ...
      • not installed,
        • install on system via git (maybe also following XDG Base Directory specs if possible...)
        • use it for the rest of the function
    • installed,
      • "find" the path of the installed version & use it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions