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
15 lines
362 B
Ruby
15 lines
362 B
Ruby
require 'tmpdir'
|
|
|
|
class Cask::Container::Tar < Cask::Container::Base
|
|
def self.me?(criteria)
|
|
criteria.file.include? 'application/x-tar'
|
|
end
|
|
|
|
def extract
|
|
Dir.mktmpdir do |staging_dir|
|
|
@command.run!('tar', :args => ['xf', @path, '-C', staging_dir])
|
|
@command.run!('ditto', :args => [staging_dir, @cask.destination_path])
|
|
end
|
|
end
|
|
end
|
|
|