mirror of
https://gitlab.com/mlunax/dotfiles.git
synced 2025-04-18 16:26:50 +00:00
Update path and rtx scripts to use local bin folder
This commit is contained in:
parent
53ea70566c
commit
3bcb5ded4e
3 changed files with 33 additions and 34 deletions
|
@ -8,5 +8,5 @@ grep -q 'npm' <<< $devTools && export PATH="$PATH:$HOME/.local/npm/bin"
|
||||||
grep -q 'GO' <<< $devTools && export PATH="$PATH:$(go env GOPATH)/bin"
|
grep -q 'GO' <<< $devTools && export PATH="$PATH:$(go env GOPATH)/bin"
|
||||||
grep -q 'android' <<< $devTools && export ANDROID_SDK_ROOT="$HOME/.android-sdk"
|
grep -q 'android' <<< $devTools && export ANDROID_SDK_ROOT="$HOME/.android-sdk"
|
||||||
grep -q 'pulumi' <<< $devTools && export PATH="$PATH:$HOME/.pulumi/bin"
|
grep -q 'pulumi' <<< $devTools && export PATH="$PATH:$HOME/.pulumi/bin"
|
||||||
[ -n $GOPATH ] && export PATH="$GOPATH/bin:$PATH"
|
#[ -n $GOPATH ] && export PATH="$GOPATH/bin:$PATH"
|
||||||
export PATH="$PATH:$HOME/.local/bin"
|
export PATH="$HOME/.local/bin:$PATH"
|
|
@ -1,4 +1,4 @@
|
||||||
if test -f "$HOME/.pyenv/bin/pyenv"; then
|
if [[ -d "$HOME/.pyenv/" ]]; then
|
||||||
export PYENV_ROOT="$HOME/.pyenv"
|
export PYENV_ROOT="$HOME/.pyenv"
|
||||||
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
|
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
|
||||||
eval "$(pyenv init -)"
|
eval "$(pyenv init -)"
|
||||||
|
|
61
.zsh/rtx.zsh
61
.zsh/rtx.zsh
|
@ -1,37 +1,36 @@
|
||||||
export RTX_SHELL=zsh
|
export RTX_SHELL=zsh
|
||||||
|
|
||||||
if iscmd rtx; then
|
if iscmd rtx; then
|
||||||
|
rtx() {
|
||||||
|
local command
|
||||||
|
command="${1:-}"
|
||||||
|
if [ "$#" = 0 ]; then
|
||||||
|
command $HOME/.cargo/bin/rtx
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
|
||||||
rtx() {
|
case "$command" in
|
||||||
local command
|
deactivate|shell)
|
||||||
command="${1:-}"
|
eval "$($HOME/.cargo/bin/rtx "$command" "$@")"
|
||||||
if [ "$#" = 0 ]; then
|
;;
|
||||||
command $HOME/.cargo/bin/rtx
|
*)
|
||||||
return
|
command $HOME/.cargo/bin/rtx "$command" "$@"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
_rtx_hook() {
|
||||||
|
trap -- '' SIGINT;
|
||||||
|
eval "$("$HOME/.cargo/bin/rtx" hook-env -s zsh)";
|
||||||
|
trap - SIGINT;
|
||||||
|
}
|
||||||
|
typeset -ag precmd_functions;
|
||||||
|
if [[ -z "${precmd_functions[(r)_rtx_hook]+1}" ]]; then
|
||||||
|
precmd_functions=( _rtx_hook ${precmd_functions[@]} )
|
||||||
|
fi
|
||||||
|
typeset -ag chpwd_functions;
|
||||||
|
if [[ -z "${chpwd_functions[(r)_rtx_hook]+1}" ]]; then
|
||||||
|
chpwd_functions=( _rtx_hook ${chpwd_functions[@]} )
|
||||||
fi
|
fi
|
||||||
shift
|
|
||||||
|
|
||||||
case "$command" in
|
|
||||||
deactivate|shell)
|
|
||||||
eval "$($HOME/.cargo/bin/rtx "$command" "$@")"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
command $HOME/.cargo/bin/rtx "$command" "$@"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
_rtx_hook() {
|
|
||||||
trap -- '' SIGINT;
|
|
||||||
eval "$("$HOME/.cargo/bin/rtx" hook-env -s zsh)";
|
|
||||||
trap - SIGINT;
|
|
||||||
}
|
|
||||||
typeset -ag precmd_functions;
|
|
||||||
if [[ -z "${precmd_functions[(r)_rtx_hook]+1}" ]]; then
|
|
||||||
precmd_functions=( _rtx_hook ${precmd_functions[@]} )
|
|
||||||
fi
|
|
||||||
typeset -ag chpwd_functions;
|
|
||||||
if [[ -z "${chpwd_functions[(r)_rtx_hook]+1}" ]]; then
|
|
||||||
chpwd_functions=( _rtx_hook ${chpwd_functions[@]} )
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue