Skip to content
Snippets Groups Projects
Commit b4fc4acc authored by Josh Hagins's avatar Josh Hagins
Browse files

hbc/locations: arg is file only if absolute or .rb file

Handle the case when an argument passed to `brew cask` is both the name
of a Cask and a non-Cask file in the current working directory.

Fixes https://github.com/caskroom/homebrew-cask/issues/25611.
parent 63122c24
No related branches found
No related tags found
No related merge requests found
......@@ -133,9 +133,8 @@ module Hbc
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, "")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment