Skip to content

Commit

Permalink
Get rid of even more T.musts
Browse files Browse the repository at this point in the history
Co-authored-by: Mike McQuaid <[email protected]>
  • Loading branch information
issyl0 and MikeMcQuaid committed Jul 3, 2024
1 parent 3d09094 commit 9baf50a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Library/Homebrew/dev-cmd/bump-formula-pr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,9 @@ def run_audit(formula, alias_rename, old_contents)
end
return
end
FileUtils.mv T.must(alias_rename.first), T.must(alias_rename.last) if alias_rename.present?
if alias_rename && (source = alias_rename.first) && (destination = alias_rename.last)
FileUtils.mv source, destination
end
failed_audit = false
if args.no_audit?
ohai "Skipping `brew audit`"
Expand All @@ -572,7 +574,9 @@ def run_audit(formula, alias_rename, old_contents)
return unless failed_audit

formula.path.atomic_write(old_contents)
FileUtils.mv T.must(alias_rename.last), T.must(alias_rename.first) if alias_rename.present?
if alias_rename && (source = alias_rename.first) && (destination = alias_rename.last)
FileUtils.mv source, destination
end
odie "`brew audit` failed!"
end
end
Expand Down

0 comments on commit 9baf50a

Please sign in to comment.