Class: Sleet::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/sleet/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/sleet/cli.rb', line 7

def self.exit_on_failure?
  true
end

Instance Method Details

#configObject



63
64
65
# File 'lib/sleet/cli.rb', line 63

def config
  Sleet::Config.new(cli_hash: options, dir: Dir.pwd).print!
end

#fetchObject

Raises:



40
41
42
43
44
45
46
47
48
49
# File 'lib/sleet/cli.rb', line 40

def fetch
  sleet_config = Sleet::Config.new(cli_hash: options, dir: Dir.pwd)
  if options[:print_config]
    sleet_config.print!
    exit
  end
  raise Sleet::Error, 'circle_ci_token required and not provided' unless sleet_config.circle_ci_token

  Sleet::FetchCommand.new(sleet_config).do!
end

#versionObject



53
54
55
56
57
58
59
# File 'lib/sleet/cli.rb', line 53

def version
  if options[:bare]
    puts Sleet::VERSION
  else
    puts "Sleet v#{Sleet::VERSION}"
  end
end