mirror of
https://github.com/donl/homebrew-cask-versions.git
synced 2026-07-17 14:26:45 -06:00
* part of DSL 1.0 review * `destination_path` was always a bit vague (it refers to Cask-specific, version-specific location under `/opt/homebrew-cask/Caskroom`) * here renamed `staged_path` to match upcoming command verb `brew cask stage` * rename also intended to reduce confusion when we implement copying as a configurable alternative to symlinking * transitional `destination_path` methods to remain while Casks are converted (this was documented as a part of the DSL, and used by 39 Casks in main repo) * unrelated variables containing "stage" recast for clarity
19 lines
661 B
Ruby
19 lines
661 B
Ruby
class Cask::Artifact::NestedContainer < Cask::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 = Cask::Container.for_path(source, @command)
|
|
unless container
|
|
raise 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
|