Merge pull request #16288 from Bo98/macos-zip-fix
unpack_strategy/zip: fix super ancestor on macOS without Sorbet Runtime
This commit is contained in:
commit
4889e102fe
@ -6,10 +6,9 @@ require "system_command"
|
|||||||
module UnpackStrategy
|
module UnpackStrategy
|
||||||
class Zip
|
class Zip
|
||||||
module MacOSZipExtension
|
module MacOSZipExtension
|
||||||
include UnpackStrategy
|
private
|
||||||
include SystemCommand::Mixin
|
|
||||||
|
|
||||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
sig { params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||||
with_env(TZ: "UTC") do
|
with_env(TZ: "UTC") do
|
||||||
if merge_xattrs && contains_extended_attributes?(path)
|
if merge_xattrs && contains_extended_attributes?(path)
|
||||||
@ -58,8 +57,6 @@ module UnpackStrategy
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
sig { params(path: Pathname).returns(T::Boolean) }
|
sig { params(path: Pathname).returns(T::Boolean) }
|
||||||
def contains_extended_attributes?(path)
|
def contains_extended_attributes?(path)
|
||||||
path.zipinfo.grep(/(^__MACOSX|\._)/).any?
|
path.zipinfo.grep(/(^__MACOSX|\._)/).any?
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# typed: strict
|
# typed: strict
|
||||||
|
|
||||||
module UnpackStrategy::Zip::MacOSZipExtension
|
module UnpackStrategy::Zip::MacOSZipExtension
|
||||||
include Kernel
|
requires_ancestor { UnpackStrategy }
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user