
Instead of only looking at the extension when invoked as part of Homebrew's formulae' download strategies instead prioritise the extension if it actually exists. When it does not, fall back to the magic detection logic which is likely to be more reliable. Fixes https://github.com/Homebrew/brew/issues/5895
16 lines
336 B
Ruby
16 lines
336 B
Ruby
module UnpackStrategy
|
|
class Uncompressed
|
|
include UnpackStrategy
|
|
|
|
def extract_nestedly(prioritise_extension: false, **options)
|
|
extract(**options)
|
|
end
|
|
|
|
private
|
|
|
|
def extract_to_dir(unpack_dir, basename:, verbose:)
|
|
FileUtils.cp path, unpack_dir/basename, preserve: true, verbose: verbose
|
|
end
|
|
end
|
|
end
|