Method: Cnvrg::Commands::Flow#export

Defined in:
lib/cnvrg/cli/flow.rb

#exportObject



63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/cnvrg/cli/flow.rb', line 63

def export()
  if options[:title].blank?
    Cnvrg::CLI.log_message("Flow title is required for export. please use --title='Flow 1'", "red")
    return
  end

  @project = Cnvrg::Project.new(Cnvrg::CLI.get_project_home)
  @flow = Flows.new(options[:title], project: @project)
  filename = @flow.export(options[:version], file: options[:file])
  Cnvrg::CLI.log_message("Flow was saved successfuly to: #{filename}", 'green')
rescue => e
  Cnvrg::CLI.log_message(e.message, 'red')
  Cnvrg::Logger.log_error(e)
end