Method: Legato::CLI#initialize

Defined in:
lib/legato/cli.rb

#initializeCLI

Returns a new instance of CLI.



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/legato/cli.rb', line 28

def initialize
  config_path = File.join(ENV['HOME'], '.legato.yml')

  if File.exists?(config_path)
    @config = YAML.load_file(config_path) rescue {}
  else
    puts "##########################################################"
    puts "We can auto-load OAuth2 config from ~/.legato.yml"
    puts "##########################################################"

    build_config
  end

  build_access_token

  print_yaml unless File.exists?(config_path)
end