Skip to content

Commit

Permalink
fix: improve audit for binary stanza
Browse files Browse the repository at this point in the history
  • Loading branch information
SMillerDev committed Jun 28, 2024
1 parent 8e570a0 commit 203049b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Library/Homebrew/cask/audit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -580,15 +580,14 @@ def audit_rosetta
add_error "No binaries in App: #{artifact.source}", location: cask.url.location if files.empty?
system_command("lipo", args: ["-archs", files.first], print_stderr: false)
when Artifact::Binary
system_command("lipo", args: ["-archs", path], print_stderr: false)
binary_path = path.to_s.gsub(cask.appdir, tmpdir)
system_command("lipo", args: ["-archs", binary_path], print_stderr: true)

Check warning on line 584 in Library/Homebrew/cask/audit.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cask/audit.rb#L584

Added line #L584 was not covered by tests
else
add_error "Unknown artifact type: #{artifact.class}", location: cask.url.location
end

unless result.success?
add_error "Failed to determine artifact architecture!", location: cask.url.location
next
end
# binary stanza can contain shell scripts, so we just continue if lipo fails.
next unless result.success?

odebug result.merged_output

Check warning on line 592 in Library/Homebrew/cask/audit.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cask/audit.rb#L592

Added line #L592 was not covered by tests

Expand Down

0 comments on commit 203049b

Please sign in to comment.