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
|
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
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
antidotewas always searched under$zshhome/.antibodySince
antidotedevs officially tell ppl you can either install it by pulling git into${ZDOTDIR:-$HOME}/.antidoteOR
install via a package manager which in turn installs
antidotein a different path.so basically here
instantSHELL/zshrc
Lines 34 to 57 in c1d559a
Tasks
.zshrcshould:antidoteis ...