diff --git a/Library/Homebrew/formula_cellar_checks.rb b/Library/Homebrew/formula_cellar_checks.rb index da14f38e17..939b55b1cc 100644 --- a/Library/Homebrew/formula_cellar_checks.rb +++ b/Library/Homebrew/formula_cellar_checks.rb @@ -150,7 +150,6 @@ module FormulaCellarChecks private def relative_glob(dir, pattern) - return [] unless Pathname.new(dir).directory? - Dir.chdir(dir) { Dir[pattern] } + File.directory?(dir) ? Dir.chdir(dir) { Dir[pattern] } : [] end end