Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change antidote default path #7

Open
7 tasks
IronicUsername opened this issue Oct 29, 2024 · 0 comments
Open
7 tasks

Change antidote default path #7

IronicUsername opened this issue Oct 29, 2024 · 0 comments

Comments

@IronicUsername
Copy link

IronicUsername commented Oct 29, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant