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:
parent
2c098cf059
commit
936a0c29a0
1 changed files with 5 additions and 5 deletions
10
.zsh/rtx.zsh
10
.zsh/rtx.zsh
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue