mirror of
https://github.com/lloeki/dotfiles.git
synced 2025-12-06 07:24:39 +01:00
Autodetect chruby better
This commit is contained in:
parent
d2dd80d9f0
commit
271d7eedca
2 changed files with 9 additions and 1 deletions
|
|
@ -1,7 +1,15 @@
|
|||
if [[ -f $HOME/.nix-profile/share/chruby/chruby.sh ]]; then
|
||||
source $HOME/.nix-profile/share/chruby/chruby.sh
|
||||
elif [[ -f /opt/arch/share/chruby/chruby.sh ]]; then
|
||||
source /opt/arch/share/chruby/chruby.sh
|
||||
elif [[ -f /usr/local/share/chruby/chruby.sh ]]; then
|
||||
source /usr/local/share/chruby/chruby.sh
|
||||
fi
|
||||
|
||||
_has-chruby() {
|
||||
type -f chruby >/dev/null 2>&1
|
||||
}
|
||||
|
||||
_ruby-version() {
|
||||
local check_dir=$PWD
|
||||
local next_check_dir=${check_dir%/*}
|
||||
|
|
|
|||
2
zsh/rc
2
zsh/rc
|
|
@ -36,7 +36,7 @@ preexec() {
|
|||
chpwd() {
|
||||
__git_ps1_gitdir
|
||||
_gopath
|
||||
_auto-chruby
|
||||
if _has-chruby; then _auto-chruby; fi
|
||||
}
|
||||
chpwd
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue