chore(rtx): install via official script instead of zinit

A bit more code, but should make installation more reliable, as zinit
often has issues detecting the correct binary/tarball to download from
GitHub releases.
This commit is contained in:
2023-09-18 10:05:54 +01:00
parent 5eb71b08a8
commit 4cd9893126
2 changed files with 21 additions and 5 deletions

2
zshenv
View File

@@ -200,13 +200,13 @@ if command-exists sccache; then
fi fi
# rtx setup # rtx setup
path_prepend "$HOME/.local/share/rtx/bin"
path_prepend "$HOME/.local/share/rtx/shims" path_prepend "$HOME/.local/share/rtx/shims"
# ============================================================================== # ==============================================================================
# Path setup for select binaries installed with zinit # Path setup for select binaries installed with zinit
# ============================================================================== # ==============================================================================
path_prepend "$HOME/.local/zsh/zinit/plugins/jdxcode---rtx"
path_prepend "$HOME/.local/zsh/zinit/plugins/junegunn---fzf" path_prepend "$HOME/.local/zsh/zinit/plugins/junegunn---fzf"
path_prepend "$HOME/.local/zsh/zinit/plugins/rbenv---rbenv/bin" path_prepend "$HOME/.local/zsh/zinit/plugins/rbenv---rbenv/bin"

24
zshrc
View File

@@ -93,10 +93,26 @@ if command-exists direnv; then
eval "$(direnv hook zsh)" eval "$(direnv hook zsh)"
fi fi
zinit light-mode wait lucid from'gh-r' as'program' pick'rtx' mv'rtx* -> rtx' \ RTX_HOME="$HOME/.local/share/rtx"
atclone'./rtx completion zsh > _rtx && chmod +x _rtx && ./rtx activate zsh > .rtx.zsh && zinit creinstall jdxcode/rtx' \ RTX_INIT="$RTX_HOME/shell/init.zsh"
atpull'%atclone' src='.rtx.zsh' \ export RTX_INSTALL_PATH="$RTX_HOME/bin/rtx"
for @jdxcode/rtx
if ! command-exists rtx; then
read -q 'REPLY?rtx is not installed, install with curl `https://rtx.pub/install.sh | sh`? [y/N]:' &&
echo && curl https://rtx.pub/install.sh | sh
fi
if [ -f "$HOME/.local/share/rtx/bin/rtx" ]; then
path_prepend "$RTX_HOME/bin"
fi
if command-exists rtx; then
if [ ! -f "$RTX_INIT" ] || [ "$RTX_INIT" -ot "$RTX_INSTALL_PATH" ]; then
mkdir -p "$(dirname "$RTX_INIT")"
rtx activate zsh > "$RTX_INIT"
fi
source "$RTX_INIT"
fi
# ============================================================================== # ==============================================================================
# Prompt # Prompt