From a0cb4e7c11e30ae15f121a2477e9cfbc25534368 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Fri, 30 Mar 2012 22:34:42 -0700 Subject: [PATCH] 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. --- Library/Homebrew/extend/pathname.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 5ea924c9c1..3adf6dfc27 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)