forked from Homebrew/brew
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
doctor.rb
41 lines (32 loc) · 825 Bytes
/
doctor.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# frozen_string_literal: true
require "system_config"
require "diagnostic"
module Cask
class Cmd
class Doctor < AbstractCommand
def initialize(*)
super
return if args.empty?
raise ArgumentError, "#{self.class.command_name} does not take arguments."
end
def summary_header
"Cask's Doctor Checkup"
end
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
def self.help
"checks for configuration issues"
end
end
end
end