mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
14 lines
365 B
Ruby
14 lines
365 B
Ruby
require_relative "generic_unar"
|
|
|
|
module UnpackStrategy
|
|
class SelfExtractingExecutable < GenericUnar
|
|
def self.can_extract?(path:, magic_number:)
|
|
return false unless magic_number.match?(/\AMZ/n)
|
|
|
|
system_command("file",
|
|
args: [path],
|
|
print_stderr: false).stdout.include?("self-extracting")
|
|
end
|
|
end
|
|
end
|