Merge pull request #7730 from MikeMcQuaid/tap-fetch-name
tap: check for invalid fetched tap name.
This commit is contained in:
commit
fe75934acf
@ -34,7 +34,10 @@ class Tap
|
|||||||
return CoreTap.instance if ["Homebrew", "Linuxbrew"].include?(user) && ["core", "homebrew"].include?(repo)
|
return CoreTap.instance if ["Homebrew", "Linuxbrew"].include?(user) && ["core", "homebrew"].include?(repo)
|
||||||
|
|
||||||
cache_key = "#{user}/#{repo}".downcase
|
cache_key = "#{user}/#{repo}".downcase
|
||||||
cache.fetch(cache_key) { |key| cache[key] = Tap.new(user, repo) }
|
tap = cache.fetch(cache_key) { |key| cache[key] = Tap.new(user, repo) }
|
||||||
|
raise "Invalid tap name '#{args.join("/")}'" unless tap.path.to_s.match?(HOMEBREW_TAP_PATH_REGEX)
|
||||||
|
|
||||||
|
tap
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.from_path(path)
|
def self.from_path(path)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user