aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
diff options
context:
space:
mode:
authorXu Cheng2015-03-24 21:03:20 +0800
committerXu Cheng2015-03-24 21:18:32 +0800
commit453990f1aa7435c79b5a2af4acf043b93149bf19 (patch)
tree575777c66bb22b3161300893159d783467b70249 /Library/Homebrew/utils.rb
parent28f26e0c9fc04fcbc78d135d3ea239e5c986963c (diff)
downloadbrew-453990f1aa7435c79b5a2af4acf043b93149bf19.tar.bz2
add method to detect shell profile file based on users' preference shell
Closes Homebrew/homebrew#38017. Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library/Homebrew/utils.rb')
-rw-r--r--Library/Homebrew/utils.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 4b2feb053..2cdd920c9 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -291,6 +291,16 @@ def paths
end.uniq.compact
end
+# return the shell profile file based on users' preference shell
+def shell_profile
+ case ENV["SHELL"]
+ when %r{/(ba)?sh} then "~/.bash_profile"
+ when %r{/zsh} then "~/.zshrc"
+ when %r{/ksh} then "~/.kshrc"
+ else "~/.bash_profile"
+ end
+end
+
module GitHub extend self
ISSUES_URI = URI.parse("https://api.github.com/search/issues")