Class: CC::CLI::Init

Inherits:
Command show all
Includes:
Analyzer
Defined in:
lib/cc/cli/init.rb

Constant Summary collapse

AUTO_EXCLUDE_PATHS =
%w[config db features node_modules script spec test vendor].freeze

Constants inherited from Command

Command::CODECLIMATE_YAML

Instance Method Summary collapse

Methods inherited from Command

command_name, #execute, #fatal, #initialize, #require_codeclimate_yml, #say, #warn

Constructor Details

This class inherits a constructor from CC::CLI::Command

Instance Method Details

#runObject



8
9
10
11
12
13
14
15
# File 'lib/cc/cli/init.rb', line 8

def run
  if filesystem.exist?(CODECLIMATE_YAML)
    say "Config file .codeclimate.yml already present.\nTry running 'validate-config' to check configuration."
  else
    create_codeclimate_yaml
    say "Config file .codeclimate.yml successfully generated.\nEdit and then try running 'validate-config' to check configuration."
  end
end