aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2009-07-31 01:18:03 +0100
committerMax Howell2009-07-31 01:18:03 +0100
commit6d64eb28d58cf15129a2746089efcebc9034b420 (patch)
tree606755b7e26a5e7634e9d87590e72f12e77a54a3 /Library
parent4ac760779ed1a118f82996717662bb6746acab2d (diff)
downloadbrew-6d64eb28d58cf15129a2746089efcebc9034b420.tar.bz2
Don't allow Keg.new for empty kegs
Kegs have to exist to be created.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/keg.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index f724a068e..b13eb423e 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -29,7 +29,9 @@ class Keg
elsif formula.is_a? Pathname
# TODO
elsif formula.is_a? String
- kids=($cellar+formula).children
+ path=$cellar+formula
+ kids=path.children
+ raise "Empty installation: #{path}" if kids.length < 1
raise "Multiple versions installed" if kids.length > 1
@path=kids[0]
@name=formula