Skip to content

Commit

Permalink
check_PATH: return early if (s)bin doesn't exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMcQuaid committed Jul 17, 2013
1 parent bb75b64 commit 435d541
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Library/Homebrew/formula_cellar_checks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ def check_PATH bin
return unless bin.directory?
return unless bin.children.length > 0

bin = (HOMEBREW_PREFIX/bin.basename).realpath
return if ORIGINAL_PATHS.include? bin
prefix_bin = (HOMEBREW_PREFIX/bin.basename)
return unless prefix_bin.directory?

["#{bin} is not in your PATH",
prefix_bin = prefix_bin.realpath
return if ORIGINAL_PATHS.include? prefix_bin

["#{prefix_bin} is not in your PATH",
"You can amend this by altering your ~/.bashrc file"]
end

Expand Down

0 comments on commit 435d541

Please sign in to comment.