diff --git a/dot_config/profile/profile.d/alias.sh.tmpl b/dot_config/profile/profile.d/alias.sh.tmpl index b9a4b4c..309d41b 100644 --- a/dot_config/profile/profile.d/alias.sh.tmpl +++ b/dot_config/profile/profile.d/alias.sh.tmpl @@ -1,5 +1,5 @@ # chezmoi:template:left-delimiter=#{{ -#{{- /* vim: filetype=sh -*/ -}} +#{{- /* vim: filetype=sh */ -}} alias ll='ls -alF' alias curl='curl --proto-default https --silent ' alias to_lower="tr '[:upper:]' '[:lower:]'" diff --git a/dot_config/profile/profile.d/base.sh.tmpl b/dot_config/profile/profile.d/base.sh.tmpl new file mode 100644 index 0000000..25df84d --- /dev/null +++ b/dot_config/profile/profile.d/base.sh.tmpl @@ -0,0 +1,42 @@ +# chezmoi:template:left-delimiter=#{{ +#{{- /* vim: filetype=sh */ -}} +#{{- if lookPath "go" -}} +#{{- if stat "/usr/local/apps/golang/current/bin" }} +if [ -d /usr/local/apps/golang/current/bin ] && ! echo "${PATH}" | grep -q /usr/local/apps/golang/current/bin ; then + PATH="/usr/local/apps/golang/current/bin:${PATH}" +fi +#{{ end -}} + +if [ -d "${HOME}/go/bin" ] && ! echo "$PATH" | grep -q "${HOME}/go/bin" ; then + PATH="${PATH}:${HOME}/go/bin" +fi +#{{- end }} + +#{{- if lookPath "cargo" }} +if [ -f "${HOME}/.cargo/env" ]; then + . "${HOME}/.cargo/env" +fi +#{{- end }} + +#{{- if lookPath "rbenv" }} +if [ "${RBENV_SHELL}" = "" ]; then + eval "$(rbenv init -)" +fi +#{{- end }} + +#{{- if lookPath "rvm" }} +if [ -d "${HOME}/.rvm/bin" ]; then + case "${PATH}" in + *"$HOME/.rvm/bin"*) ;; + *) export PATH="$PATH:$HOME/.rvm/bin" ;; + esac +fi + +if [ "$(ps -p $$ -ocomm=)" = sh ]; then + if [ -f "$HOME/.rvm/scripts/rvm" ]; then + # Load RVM into a shell session *as a function* + # shellcheck disable=SC1091 + . "$HOME/.rvm/scripts/rvm" + fi +fi +#{{- end }} diff --git a/dot_config/profile/profile.d/go.sh.tmpl b/dot_config/profile/profile.d/go.sh.tmpl deleted file mode 100644 index 9825012..0000000 --- a/dot_config/profile/profile.d/go.sh.tmpl +++ /dev/null @@ -1,13 +0,0 @@ -# chezmoi:template:left-delimiter=#{{ -#{{- /* vim: filetype=sh */ -}} -#{{- if lookPath "go" -}} -#{{ if stat "/usr/local/apps/golang/current/bin" -}} -if [ -d /usr/local/apps/golang/current/bin ] && ! echo "${PATH}" | grep -q /usr/local/apps/golang/current/bin ; then - PATH="/usr/local/apps/golang/current/bin:${PATH}" -fi -#{{- end }} - -if [ -d "${HOME}/go/bin" ] && ! echo "$PATH" | grep -q "${HOME}/go/bin" ; then - PATH="${PATH}:${HOME}/go/bin" -fi -#{{- end }} diff --git a/dot_config/profile/profile.d/ruby.sh.tmpl b/dot_config/profile/profile.d/ruby.sh.tmpl deleted file mode 100644 index 30706ee..0000000 --- a/dot_config/profile/profile.d/ruby.sh.tmpl +++ /dev/null @@ -1,26 +0,0 @@ -# chezmoi:template:left-delimiter=#{{ -#{{- /* vim: filetype=sh */ -}} -#{{- if lookPath "rbenv" -}} -# shellcheck shell=sh - -if [ "${RBENV_SHELL}" = "" ]; then - eval "$(rbenv init -)" -fi -#{{- end }} - -#{{ if lookPath "rvm" -}} -if [ -d "${HOME}/.rvm/bin" ]; then - case "${PATH}" in - *"$HOME/.rvm/bin"*) ;; - *) export PATH="$PATH:$HOME/.rvm/bin" ;; - esac -fi - -if [ "$(ps -p $$ -ocomm=)" = sh ]; then - if [ -f "$HOME/.rvm/scripts/rvm" ]; then - # Load RVM into a shell session *as a function* - # shellcheck disable=SC1091 - . "$HOME/.rvm/scripts/rvm" - fi -fi -#{{- end }} diff --git a/dot_config/profile/profile.d/rust.sh.tmpl b/dot_config/profile/profile.d/rust.sh.tmpl deleted file mode 100644 index 041f5d7..0000000 --- a/dot_config/profile/profile.d/rust.sh.tmpl +++ /dev/null @@ -1,7 +0,0 @@ -# chezmoi:template:left-delimiter=#{{ -#{{- /* vim: filetype=sh */ -}} -#{{- if lookPath "cargo" -}} -if [ -f "${HOME}/.cargo/env" ]; then - . "${HOME}/.cargo/env" -fi -#{{- end }}