aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/patch.rb
diff options
context:
space:
mode:
authorMarkus Reiter2016-09-23 22:02:23 +0200
committerMarkus Reiter2016-09-24 12:24:35 +0200
commit58e36c73193befb57d351344cea2a4a33fef850d (patch)
tree3d26751835440341e5a42a189cf580e6253785df /Library/Homebrew/patch.rb
parentbbc3f1c3a852e6cfd26a7a7c333092fae0520eb4 (diff)
downloadbrew-58e36c73193befb57d351344cea2a4a33fef850d.tar.bz2
Fix Style/GuardClause.
Diffstat (limited to 'Library/Homebrew/patch.rb')
-rw-r--r--Library/Homebrew/patch.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/Library/Homebrew/patch.rb b/Library/Homebrew/patch.rb
index 74e58e526..1b7751ba3 100644
--- a/Library/Homebrew/patch.rb
+++ b/Library/Homebrew/patch.rb
@@ -130,14 +130,13 @@ class ExternalPatch
patch_dir = Pathname.pwd
if patch_files.empty?
children = patch_dir.children
- if children.length == 1 && children.first.file?
- patch_files << children.first.basename
- else
+ if children.length != 1 || !children.first.file?
raise MissingApplyError, <<-EOS.undent
There should be exactly one patch file in the staging directory unless
the "apply" method was used one or more times in the patch-do block.
EOS
end
+ patch_files << children.first.basename
end
dir.cd do
patch_files.each do |patch_file|