Method: AwsAuditor::Scripts::Export.execute

Defined in:
lib/aws_auditor/scripts/export.rb

.execute(environment, options = nil) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/aws_auditor/scripts/export.rb', line 16

def self.execute(environment, options = nil)
  @environment = environment
  (puts "Must specify either --drive or --csv"; exit) unless options[:csv] || options[:drive]
  aws(environment)
  print "Gathering info, please wait..."
  all_keys = get_all_keys
  all_info = prepare
  print "\r" + " " * 50 + "\r"

  create_csv(all_keys,all_info) if options[:csv]
  upload_to_drive(all_keys,all_info) if options[:drive]
end