Class: Deploio::Commands::Projects

Inherits:
Thor
  • Object
show all
Includes:
SharedOptions
Defined in:
lib/deploio/commands/projects.rb

Instance Method Summary collapse

Methods included from SharedOptions

included

Instance Method Details

#listObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/deploio/commands/projects.rb', line 19

def list
  setup_options
  raw_projects = @nctl.get_projects

  if options[:json]
    puts JSON.pretty_generate(raw_projects)
    return
  end

  if raw_projects.empty?
    Output.warning("No projects found") unless merged_options[:dry_run]
    return
  end

  current_org = @nctl.current_org
  show_price = merged_options[:chf]

  if show_price
    display_projects_with_breakdown(raw_projects, current_org)
  else
    display_projects_simple(raw_projects, current_org)
  end
end