Skip to content
Snippets Groups Projects
Commit d8bdcf84 authored by Jack Nagel's avatar Jack Nagel
Browse files

Remove obsolete guards around canonical_name return value

parent 20f4b317
No related branches found
No related tags found
No related merge requests found
......@@ -27,11 +27,7 @@ module Homebrew extend self
# Don't use ARGV.formulae as that will throw if the file doesn't parse
paths = ARGV.named.map do |name|
name = Formula.canonical_name name
if name.include? '/'
Pathname.new(name)
else
Formula.path(name)
end
Formula.path(name)
end
unless ARGV.force?
paths.each do |path|
......
......@@ -18,10 +18,6 @@ module Homebrew extend self
else
ARGV.named.each do |name|
name = Formula.canonical_name(name)
# FIXME canonical_name is insane
raise "Invalid usage" if name.include? '/'
rack = HOMEBREW_CELLAR/name
if rack.directory?
......
......@@ -19,16 +19,9 @@ module HomebrewArgvExtension
require 'formula'
@kegs ||= downcased_unique_named.collect do |name|
canonical_name = Formula.canonical_name(name)
if canonical_name.include? "/"
# canonical_name returns a path if it was a formula installed via a
# URL. And we only want the name. FIXME that function is insane.
rack = HOMEBREW_CELLAR/Pathname.new(canonical_name).stem
else
rack = HOMEBREW_CELLAR/canonical_name
end
rack = HOMEBREW_CELLAR/canonical_name
dirs = rack.directory? ? rack.subdirs : []
raise NoSuchKegError.new(rack.basename.to_s) if not rack.directory? or dirs.empty?
linked_keg_ref = HOMEBREW_REPOSITORY/"Library/LinkedKegs"/name
......
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