diff options
| author | Jack Nagel | 2014-02-22 21:39:38 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-02-22 21:39:38 -0500 |
| commit | 85feea33c003748740f3a3dc1e410549afa50e95 (patch) | |
| tree | cc8d20b1fc1e2d534d5dd0f32d2c167b16612be4 /Library/Homebrew | |
| parent | a836602024146c8f1bf849a068c94f7023bd0f13 (diff) | |
| download | brew-85feea33c003748740f3a3dc1e410549afa50e95.tar.bz2 | |
Hoist assignment to simplify a conditional
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/formula.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 15b9734fc..e48d21a2c 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -548,6 +548,7 @@ class Formula # Throws if there's an error def system cmd, *args removed_ENV_variables = {} + rd, wr = IO.pipe # remove "boring" arguments so that the important ones are more likely to # be shown considering that we trim long ohai lines to the terminal width @@ -568,7 +569,6 @@ class Formula logfn = "#{logd}/%02d.%s" % [@exec_count, File.basename(cmd).split(' ').first] mkdir_p(logd) - rd, wr = IO.pipe fork do ENV['HOMEBREW_CC_LOG_PATH'] = logfn rd.close @@ -601,7 +601,7 @@ class Formula end end ensure - rd.close if rd and not rd.closed? + rd.close unless rd.closed? ENV.update(removed_ENV_variables) end |
