38 lines
738 B
Ruby
Raw Normal View History

2020-10-10 14:16:11 +02:00
# typed: false
# frozen_string_literal: true
2018-09-06 08:29:14 +02:00
module Cask
2018-09-04 08:45:48 +01:00
class Cmd
2020-08-19 10:34:07 +02:00
# Implementation of the `brew cask doctor` command.
#
# @api private
2017-05-20 19:08:03 +02:00
class Doctor < AbstractCommand
2020-08-01 02:30:46 +02:00
def self.max_named
0
2017-05-21 00:15:56 +02:00
end
2020-08-01 02:30:46 +02:00
def self.description
"Checks for configuration issues."
end
2017-05-21 00:15:56 +02:00
def run
2020-08-18 00:23:23 +01:00
require "diagnostic"
success = true
2020-08-19 17:12:32 +01:00
checks = Homebrew::Diagnostic::Checks.new(verbose: 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
end
2016-08-18 22:11:42 +03:00
end
end