42 lines
825 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2017-11-03 08:37:06 +10:00
require "system_config"
require "diagnostic"
2017-11-03 08:37:06 +10:00
2018-09-06 08:29:14 +02:00
module Cask
2018-09-04 08:45:48 +01:00
class Cmd
2017-05-20 19:08:03 +02:00
class Doctor < AbstractCommand
2017-05-21 00:15:56 +02:00
def initialize(*)
super
return if args.empty?
2018-09-17 02:45:00 +02:00
2017-05-21 00:15:56 +02:00
raise ArgumentError, "#{self.class.command_name} does not take arguments."
end
def summary_header
2018-01-29 13:43:21 +00:00
"Cask's Doctor Checkup"
end
2017-05-21 00:15:56 +02:00
def run
success = true
checks = Homebrew::Diagnostic::Checks.new true
checks.cask_checks.each do |check|
out = checks.send(check)
if out.present?
success = false
puts out
end
end
raise CaskError, "There are some problems with your setup." unless success
end
2016-09-24 13:52:43 +02:00
def self.help
"checks for configuration issues"
end
end
2016-08-18 22:11:42 +03:00
end
end