Skip to content

Commit

Permalink
Merge pull request Homebrew#1315 from jawshooah/cask/load-only-rb
Browse files Browse the repository at this point in the history
hbc/locations: arg is file only if absolute or .rb file
  • Loading branch information
jawshooah committed Oct 19, 2016
2 parents b9fe36a + b4fc4ac commit c18441e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Library/Homebrew/cask/lib/hbc/locations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,8 @@ def default_tap
def path(query)
query_path = Pathname.new(query)

if query_path.exist? || query_path.absolute?
return query_path
end
return query_path if query_path.absolute?
return query_path if query_path.exist? && query_path.extname == ".rb"

query_without_extension = query.sub(%r{\.rb$}i, "")

Expand Down

0 comments on commit c18441e

Please sign in to comment.