From 6913fee89aad51a8175c1a14fe9fb9bc295d4437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Mon, 26 Oct 2015 15:45:52 +0100 Subject: [PATCH] If there is `.bashrc` but no `.bash_profile`, recommend the former This is for Linux desktop platforms that have Terminal application configured to start shells in interactive but not login mode. Creating a `~/.bash_profile` would also cause `~/.profile` to not run, which might be a problem on Ubuntu which ships with a default `~/.profile`. --- libexec/rbenv-init | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libexec/rbenv-init b/libexec/rbenv-init index 29f521f3..88f9e69c 100755 --- a/libexec/rbenv-init +++ b/libexec/rbenv-init @@ -34,7 +34,11 @@ root="${0%/*}/.." if [ -z "$print" ]; then case "$shell" in bash ) - profile='~/.bash_profile' + if [ -f "${HOME}/.bashrc" ] && [ ! -f "${HOME}/.bash_profile" ]; then + profile='~/.bashrc' + else + profile='~/.bash_profile' + fi ;; zsh ) profile='~/.zshrc'