aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/utils.rb')
-rw-r--r--Library/Homebrew/utils.rb37
1 files changed, 16 insertions, 21 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index be629f1df..58083fe1b 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -218,13 +218,9 @@ def interactive_shell(f = nil)
Process.wait fork { exec ENV["SHELL"] }
- if $?.success?
- return
- elsif $?.exited?
- raise "Aborted due to non-zero exit status (#{$?.exitstatus})"
- else
- raise $?.inspect
- end
+ return if $?.success?
+ raise "Aborted due to non-zero exit status (#{$?.exitstatus})" if $?.exited?
+ raise $?.inspect
end
module Homebrew
@@ -325,13 +321,12 @@ module Homebrew
end
end
- if $times.nil?
- $times = {}
- at_exit do
- col_width = [$times.keys.map(&:size).max + 2, 15].max
- $times.sort_by { |_k, v| v }.each do |method, time|
- puts format("%-*s %0.4f sec", col_width, "#{method}:", time)
- end
+ return unless $times.nil?
+ $times = {}
+ at_exit do
+ col_width = [$times.keys.map(&:size).max + 2, 15].max
+ $times.sort_by { |_k, v| v }.each do |method, time|
+ puts format("%-*s %0.4f sec", col_width, "#{method}:", time)
end
end
end
@@ -608,14 +603,14 @@ def link_src_dst_dirs(src_dir, dst_dir, command, link_dir: false)
dst_dir.parent.mkpath
dst.make_relative_symlink(src)
end
- unless conflicts.empty?
- onoe <<-EOS.undent
- Could not link:
- #{conflicts.join("\n")}
- Please delete these paths and run `#{command}`.
- EOS
- end
+ return if conflicts.empty?
+ onoe <<-EOS.undent
+ Could not link:
+ #{conflicts.join("\n")}
+
+ Please delete these paths and run `#{command}`.
+ EOS
end
def link_path_manpages(path, command)