aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend/pathname.rb
diff options
context:
space:
mode:
authorAdam Vandenberg2012-03-30 22:34:42 -0700
committerAdam Vandenberg2012-03-30 22:36:45 -0700
commit423a8c34fe5c77a9fafc2b00a8fa55ec2dd4df2c (patch)
tree7b29d79c5aa8a8aa1575cc261de4cb7e273a12ed /Library/Homebrew/extend/pathname.rb
parentfa08d70b6ba8bedc97d1e7faa02c7eb88165ce7d (diff)
downloadhomebrew-423a8c34fe5c77a9fafc2b00a8fa55ec2dd4df2c.tar.bz2
install: warn when passed no files
Rationale: we warn when inreplace makes no changes; this is a similar sort of warning. We expected some list (probably via Dir) to include some files, but none were found. Either the list was wrong, or the install can now be omitted.
Diffstat (limited to 'Library/Homebrew/extend/pathname.rb')
-rw-r--r--Library/Homebrew/extend/pathname.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 5ea924c9c..3adf6dfc2 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -8,8 +8,16 @@ class Pathname
sources.each do |src|
case src
when Array
+ if src.empty?
+ opoo "install was passed an empty array"
+ return []
+ end
src.each {|s| results << install_p(s) }
when Hash
+ if src.empty?
+ opoo "install was passed an empty hash"
+ return []
+ end
src.each {|s, new_basename| results << install_p(s, new_basename) }
else
results << install_p(src)