diff --git a/ruby/.config/bash/bashrc.d/ruby.sh b/dot_config/bash/bashrc.d/ruby.sh.tmpl similarity index 81% rename from ruby/.config/bash/bashrc.d/ruby.sh rename to dot_config/bash/bashrc.d/ruby.sh.tmpl index ef79a1f..b94823c 100644 --- a/ruby/.config/bash/bashrc.d/ruby.sh +++ b/dot_config/bash/bashrc.d/ruby.sh.tmpl @@ -1,3 +1,4 @@ +{{ if lookPath "rbenv" -}} # shellcheck shell=bash if [ "${RBENV_SHELL}" = "" ]; then @@ -5,10 +6,12 @@ if [ "${RBENV_SHELL}" = "" ]; then eval "$(rbenv init -)" fi fi - +{{ end }} +{{- if lookPath "rvm" -}} if [[ -d "${HOME}/.rvm/bin" ]]; then # shellcheck disable=SC2076 if [[ ! "${PATH}" =~ "${HOME}/.rvm/bin" ]]; then export PATH="$PATH:$HOME/.rvm/bin" fi fi +{{- end }} diff --git a/ruby/.config/profile/profile.d/ruby.sh b/dot_config/profile/profile.d/ruby.sh.tmpl similarity index 87% rename from ruby/.config/profile/profile.d/ruby.sh rename to dot_config/profile/profile.d/ruby.sh.tmpl index b3b56a2..d185167 100644 --- a/ruby/.config/profile/profile.d/ruby.sh +++ b/dot_config/profile/profile.d/ruby.sh.tmpl @@ -1,3 +1,4 @@ +{{ if lookPath "rbenv" -}} # shellcheck shell=sh if [ "${RBENV_SHELL}" = "" ]; then @@ -5,7 +6,9 @@ if [ "${RBENV_SHELL}" = "" ]; then eval "$(rbenv init -)" fi fi +{{- end }} +{{ if lookPath "rvm" -}} if [ -d "${HOME}/.rvm/bin" ]; then case "${PATH}" in *"$HOME/.rvm/bin"*) ;; @@ -20,3 +23,4 @@ if [ "$(ps -p $$ -ocomm=)" = sh ]; then . "$HOME/.rvm/scripts/rvm" fi fi +{{- end }} diff --git a/ruby/.config/zsh/zshrc.d/ruby.zsh b/dot_config/zsh/zshrc.d/ruby.zsh.tmpl similarity index 78% rename from ruby/.config/zsh/zshrc.d/ruby.zsh rename to dot_config/zsh/zshrc.d/ruby.zsh.tmpl index 5188b8e..e1e58e8 100644 --- a/ruby/.config/zsh/zshrc.d/ruby.zsh +++ b/dot_config/zsh/zshrc.d/ruby.zsh.tmpl @@ -1,11 +1,15 @@ +{{ if lookPath "rbenv" -}} if [ "${RBENV_SHELL}" = "" ]; then if command -v rbenv >/dev/null 2>&1 ; then eval "$(rbenv init -)" fi fi +{{- end }} +{{ if lookPath "rvm" -}} if [[ -d "${HOME}/.rvm/bin" ]]; then if [[ ! "${PATH}" =~ "${HOME}/.rvm/bin" ]]; then export PATH="$PATH:$HOME/.rvm/bin" fi fi +{{- end }} diff --git a/ruby/.local/bin/install-rvm b/dot_local/bin/executable_install-rvm old mode 100755 new mode 100644 similarity index 100% rename from ruby/.local/bin/install-rvm rename to dot_local/bin/executable_install-rvm