mirror of
https://github.com/donl/homebrew-cask-versions.git
synced 2026-07-16 22:06:43 -06:00
* convert existing Cask:: namespace to Hbc:: * move Homebrew-fork code under Hbc:: * move freestanding classes such as Tty and TopologicalHash under Hbc:: * recast HOMEBREW_CASK_ constants as HBC_ * modify our Homebrew Formula for backward compatibility * devscripts and dev docs
19 lines
663 B
Ruby
19 lines
663 B
Ruby
class Hbc::Artifact::NestedContainer < Hbc::Artifact::Base
|
|
def install_phase
|
|
@cask.artifacts[:nested_container].each { |container| extract(container) }
|
|
end
|
|
|
|
def uninstall_phase
|
|
# no need to take action; we will get removed by rmtree of parent
|
|
end
|
|
|
|
def extract(container_relative_path)
|
|
source = @cask.staged_path.join(container_relative_path)
|
|
container = Hbc::Container.for_path(source, @command)
|
|
unless container
|
|
raise Hbc::CaskError.new "Aw dang, could not identify nested container at '#{source}'"
|
|
end
|
|
ohai "Extracting nested container #{source.basename}"
|
|
container.new(@cask, source, @command).extract
|
|
end
|
|
end
|