diff options
| author | Greg Nisbet | 2016-05-22 16:03:51 -0700 | 
|---|---|---|
| committer | Greg Nisbet | 2016-08-10 23:21:30 -0700 | 
| commit | f0cc815d86aceec61adca10606124ad840b0398a (patch) | |
| tree | e6f6839d0531e7be98ed82fdf95450da3e95c1fd /Library/Homebrew/utils/shell.rb | |
| parent | f1ce3585511c6c13a0628534c0399a3638f98596 (diff) | |
| download | brew-f0cc815d86aceec61adca10606124ad840b0398a.tar.bz2 | |
Multi-shell diagnostic check
Diffstat (limited to 'Library/Homebrew/utils/shell.rb')
| -rw-r--r-- | Library/Homebrew/utils/shell.rb | 11 | 
1 files changed, 11 insertions, 0 deletions
diff --git a/Library/Homebrew/utils/shell.rb b/Library/Homebrew/utils/shell.rb index ca6eace8b..d2301345f 100644 --- a/Library/Homebrew/utils/shell.rb +++ b/Library/Homebrew/utils/shell.rb @@ -69,5 +69,16 @@ module Utils      def self.shell_profile        SHELL_PROFILE_MAP.fetch(preferred_shell, "~/.bash_profile")      end + +    def self.prepend_path_in_shell_profile(path) +      case preferred_shell  +      when :bash, :ksh, :sh, :zsh +        "echo 'export PATH=\"#{sh_quote(path)}:$PATH >> #{shell_profile}" +      when :csh, :tcsh +        "echo 'setenv PATH #{csh_quote(path)}:$PATH' >> #{shell_profile}" +      when :fish +        "echo 'set -g fish_user_paths $fish_user_paths >> #{sh_quote(path)}' >> #{shell_profile}" +      end +    end    end  end  | 
