1
0
Fork 0
mirror of https://gitlab.com/mlunax/dotfiles.git synced 2025-04-18 16:26:50 +00:00

fix rtx path

This commit is contained in:
Luna 2023-11-21 13:09:38 +01:00
parent 2c098cf059
commit 936a0c29a0

View file

@ -1,28 +1,28 @@
export RTX_SHELL=zsh export RTX_SHELL=zsh
RTX_BIN_PATH=$(whereis rtx | cut -d ':' -f2 | xargs)
if iscmd rtx; then if iscmd rtx; then
rtx() { rtx() {
local command local command
command="${1:-}" command="${1:-}"
if [ "$#" = 0 ]; then if [ "$#" = 0 ]; then
command $HOME/.cargo/bin/rtx command $RTX_BIN_PATH
return return
fi fi
shift shift
case "$command" in case "$command" in
deactivate|shell) deactivate|shell)
eval "$($HOME/.cargo/bin/rtx "$command" "$@")" eval "$($RTX_BIN_PATH "$command" "$@")"
;; ;;
*) *)
command $HOME/.cargo/bin/rtx "$command" "$@" command $RTX_BIN_PATH "$command" "$@"
;; ;;
esac esac
} }
_rtx_hook() { _rtx_hook() {
trap -- '' SIGINT; trap -- '' SIGINT;
eval "$("$HOME/.cargo/bin/rtx" hook-env -s zsh)"; eval "$("$RTX_BIN_PATH" hook-env -s zsh)";
trap - SIGINT; trap - SIGINT;
} }
typeset -ag precmd_functions; typeset -ag precmd_functions;