diff options
| author | mail_redacted_for_web | 2026-04-19 09:55:58 +0200 |
|---|---|---|
| committer | mail_redacted_for_web | 2026-04-19 09:55:58 +0200 |
| commit | 2bb726171720cdecc7ddd7cd1416f82b7f33d8c4 (patch) | |
| tree | 00ca8c025623e61b34fe0c3f96fe89a5fa48e6a7 /.bash/vars.bash | |
| parent | a4e23cdaff9bfd127e96f6b0f39bc6577cc7c7d4 (diff) | |
| download | dotfiles-2bb726171720cdecc7ddd7cd1416f82b7f33d8c4.tar.bz2 | |
feat: add local Ruby gems' bin folder to $PATH
Diffstat (limited to '.bash/vars.bash')
| -rw-r--r-- | .bash/vars.bash | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/.bash/vars.bash b/.bash/vars.bash index 3bc68cd..29a3dfd 100644 --- a/.bash/vars.bash +++ b/.bash/vars.bash @@ -80,6 +80,20 @@ if command -v less >/dev/null;then export LESSANSIENDCHARS="m" export LESSANSIMIDCHARS="0123456789:;[?!\"'#%()*+ " fi + +# ----- RUBY ----- # +# Include local gems' binary path from those gems matching /usr/bin/ruby: +if [ -x '/usr/bin/ruby' ]; then + rubymajmin="$(/usr/bin/ruby -e 'print(RUBY_VERSION.gsub(%r{\.[0-9]+$}, '\'\''))')" + rubypath="${HOME}/.gem/ruby/${rubymajmin}.0/bin" + unset rubymajmin + if [ -d "$rubypath" ]; then + if ! printf '%b' "$PATH" | grep -P "(^|:)${rubypath}(:|$)" > /dev/null; then + PATH="${PATH}:$rubypath" + fi + fi +fi + # ----- MISC ----- # # nopaste export NOPASTE_SERVICES='pastebin nopaste' |
