diff options
| author | Greg Nisbet | 2016-06-14 22:31:48 -0700 |
|---|---|---|
| committer | Greg Nisbet | 2016-08-10 23:21:30 -0700 |
| commit | dcc3377aa30b34dfcced0df77696674f91a5a9f3 (patch) | |
| tree | 0e0e2133f7e7f335b252c6aaeb8ce8bcba79161d /Library | |
| parent | bf63c08d50acb5fa79413325029e67e2c28a6023 (diff) | |
| download | brew-dcc3377aa30b34dfcced0df77696674f91a5a9f3.tar.bz2 | |
move shell_profile to compat/utils.rb & deprecate
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/compat/utils.rb | 10 | ||||
| -rw-r--r-- | Library/Homebrew/utils.rb | 10 | ||||
| -rw-r--r-- | Library/Homebrew/utils/shell.rb | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/Library/Homebrew/compat/utils.rb b/Library/Homebrew/compat/utils.rb new file mode 100644 index 000000000..7de5e85c3 --- /dev/null +++ b/Library/Homebrew/compat/utils.rb @@ -0,0 +1,10 @@ +# return the shell profile file based on users' preference shell +def shell_profile + opoo "shell_profile has been deprecated in favor of Utils::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 diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index f78fbfcb7..8e6a9b7d7 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -519,16 +519,6 @@ 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 - def disk_usage_readable(size_in_bytes) if size_in_bytes >= 1_073_741_824 size = size_in_bytes.to_f / 1_073_741_824 diff --git a/Library/Homebrew/utils/shell.rb b/Library/Homebrew/utils/shell.rb index 19e696795..c0d6b90ae 100644 --- a/Library/Homebrew/utils/shell.rb +++ b/Library/Homebrew/utils/shell.rb @@ -76,7 +76,7 @@ module Utils def self.prepend_path_in_shell_profile(path) case preferred_shell when :bash, :ksh, :sh, :zsh, nil - "echo 'export PATH=\"#{sh_quote(path)}:$PATH'\" >> #{shell_profile}" + "echo 'export PATH=\"#{sh_quote(path)}:$PATH\"' >> #{shell_profile}" when :csh, :tcsh "echo 'setenv PATH #{csh_quote(path)}:$PATH' >> #{shell_profile}" when :fish |
