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
24 lines
921 B
Ruby
24 lines
921 B
Ruby
require 'hbc/staged'
|
|
|
|
class Hbc::DSL::Postflight < Hbc::DSL::Base
|
|
include Hbc::Staged
|
|
|
|
def suppress_move_to_applications(options = {})
|
|
permitted_keys = [:key]
|
|
unknown_keys = options.keys - permitted_keys
|
|
unless unknown_keys.empty?
|
|
opoo %Q{Unknown arguments to suppress_move_to_applications -- #{unknown_keys.inspect} (ignored). Running "brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup" will likely fix it.}
|
|
end
|
|
key = options[:key] || 'moveToApplicationsFolderAlertSuppress'
|
|
begin
|
|
@command.run!('/usr/bin/defaults', :args => ['write', bundle_identifier, key, '-bool', 'true'])
|
|
rescue StandardError => e
|
|
raise Hbc::CaskError.new("#{@cask.token}: 'suppress_move_to_applications' failed with: #{e}")
|
|
end
|
|
end
|
|
|
|
def method_missing(method, *args)
|
|
Hbc::Utils.method_missing_message(method, @cask.to_s, 'postflight')
|
|
return nil
|
|
end
|
|
end
|