2013-10-20 05:17:45 +08:00
|
|
|
class Cask::Artifact::NestedContainer < Cask::Artifact::Base
|
|
|
|
def install
|
|
|
|
@cask.artifacts[:nested_container].each { |container| extract(container) }
|
|
|
|
end
|
|
|
|
|
|
|
|
def uninstall
|
|
|
|
# no need to take action; we will get removed by rmtree of parent
|
|
|
|
end
|
|
|
|
|
|
|
|
def extract(container_relative_path)
|
|
|
|
source = @cask.destination_path.join(container_relative_path)
|
|
|
|
container = Cask::Container.for_path(source, @command)
|
|
|
|
unless container
|
2014-02-20 07:47:39 +08:00
|
|
|
raise CaskError.new "Aw dang, could not identify nested_container at '#{source}'"
|
2013-10-20 05:17:45 +08:00
|
|
|
end
|
|
|
|
ohai "Extracting nested container #{source.basename}"
|
|
|
|
container.new(@cask, source, @command).extract
|
|
|
|
end
|
|
|
|
end
|