Compare commits

...

2 Commits

Author SHA1 Message Date
Dennis Dashkevich 9172f9287c
Merge ef4ecc3c39 into 6e7ac0544e 2025-02-20 06:29:34 +01:00
Dennis Dashkevich ef4ecc3c39
fix(chruby): fix the `rubies` command output 2025-02-16 12:55:41 +03:00
1 changed files with 13 additions and 19 deletions

View File

@ -15,6 +15,13 @@ _source-from-omz-settings() {
fi
}
_source-from-default-location() {
[[ -r /usr/local/share/chruby/chruby.sh ]] || return 1
source /usr/local/share/chruby/chruby.sh
source /usr/local/share/chruby/auto.sh
}
_source-from-homebrew() {
(( $+commands[brew] )) || return 1
@ -36,27 +43,14 @@ _source-from-homebrew() {
source $_brew_prefix/share/chruby/auto.sh
}
_load-chruby-dirs() {
local dir
for dir in "$HOME/.rubies" "$PREFIX/opt/rubies"; do
if [[ -d "$dir" ]]; then
RUBIES+=("$dir")
fi
done
}
# Load chruby
if _source-from-omz-settings; then
_load-chruby-dirs
elif [[ -r "/usr/local/share/chruby/chruby.sh" ]] ; then
source /usr/local/share/chruby/chruby.sh
source /usr/local/share/chruby/auto.sh
_load-chruby-dirs
elif _source-from-homebrew; then
_load-chruby-dirs
fi
_source-from-omz-settings || \
_source-from-default-location || \
_source-from-homebrew
unfunction _source-from-homebrew _source-from-omz-settings _load-chruby-dirs
unfunction _source-from-homebrew \
_source-from-default-location \
_source-from-omz-settings
## chruby utility functions and aliases