mirror of
https://github.com/donl/homebrew-cask-versions.git
synced 2026-07-17 06:16:47 -06:00
- add `run!` method which raises if command does not succeed - use `run!` when the command we are running must succeed for things to move forward. this should help produce clearer error messages in failure scenarios. - move caveats earlier in the install process so reports can be made about potential failures - remove the destination tree on cask install failure, so the cask will not be considered installed
14 lines
403 B
Ruby
14 lines
403 B
Ruby
require 'tmpdir'
|
|
|
|
class Cask::Container::Zip < Cask::Container::Base
|
|
def self.me?(criteria)
|
|
criteria.file.include? 'compressed-encoding=application/zip;'
|
|
end
|
|
|
|
def extract
|
|
Dir.mktmpdir do |staging_dir|
|
|
@command.run!('unzip', :args => ['-qq', '-d', staging_dir, @path, '-x', '__MACOSX/*'])
|
|
@command.run!('ditto', :args => [staging_dir, @cask.destination_path])
|
|
end
|
|
end
|
|
end
|