From 02a70496b61731e1a7fb94c5909fe99f2e09e5fc Mon Sep 17 00:00:00 2001 From: Mike McQuaid <mike@mikemcquaid.com> Date: Wed, 23 Jan 2019 15:46:03 +0000 Subject: [PATCH] style: better handle file arguments. Fixes #5588. --- Library/Homebrew/style.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/style.rb b/Library/Homebrew/style.rb index ca47f72043..c4886c6211 100644 --- a/Library/Homebrew/style.rb +++ b/Library/Homebrew/style.rb @@ -61,7 +61,7 @@ module Homebrew end if files && !has_non_formula - config = if (files.first/"spec").exist? + config = if files.first && File.exist?("#{files.first}/spec") HOMEBREW_LIBRARY/".rubocop_rspec.yml" else HOMEBREW_LIBRARY/".rubocop_audit.yml" -- GitLab