diff options
Diffstat (limited to 'Library/Homebrew/extend/fileutils.rb')
| -rw-r--r-- | Library/Homebrew/extend/fileutils.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Library/Homebrew/extend/fileutils.rb b/Library/Homebrew/extend/fileutils.rb index 3a2b32481..4f20d36a3 100644 --- a/Library/Homebrew/extend/fileutils.rb +++ b/Library/Homebrew/extend/fileutils.rb @@ -84,15 +84,14 @@ module FileUtils end # @private - alias_method :old_mkdir, :mkdir + alias old_mkdir mkdir # A version of mkdir that also changes to that folder in a block. def mkdir(name, &_block) mkdir_p(name) - if block_given? - chdir name do - yield - end + return unless block_given? + chdir name do + yield end end module_function :mkdir @@ -122,7 +121,7 @@ module FileUtils if method_defined?(:ruby) # @private - alias_method :old_ruby, :ruby + alias old_ruby ruby end # Run the `ruby` Homebrew is using rather than whatever is in the `PATH`. |
