2020-08-26 03:13:58 +02:00

20 lines
398 B
Ruby

# frozen_string_literal: true
require_relative "uncompressed"
module UnpackStrategy
# Strategy for unpacking macOS package installers.
class Pkg < Uncompressed
using Magic
def self.extensions
[".pkg", ".mkpg"]
end
def self.can_extract?(path)
path.extname.match?(/\A.m?pkg\Z/) &&
(path.directory? || path.magic_number.match?(/\Axar!/n))
end
end
end