Merge pull request #4009 from ebernhardson/export_category_filename

Take filename to write to as optional parameter to export_category
This commit is contained in:
Régis Hanol 2016-02-16 10:53:22 +01:00
commit c33a6ddfed
2 changed files with 4 additions and 4 deletions

View File

@ -6,8 +6,8 @@ require "json"
module ImportExport
def self.export_category(category_id)
ImportExport::CategoryExporter.new(category_id).perform.save_to_file
def self.export_category(category_id, filename=nil)
ImportExport::CategoryExporter.new(category_id).perform.save_to_file(filename)
end
def self.import_category(filename)

View File

@ -135,12 +135,12 @@ class DiscourseCLI < Thor
end
desc "export_category", "Export a category, all its topics, and all users who posted in those topics"
def export_category(category_id)
def export_category(category_id, filename=nil)
raise "Category id argument is missing!" unless category_id
load_rails
load_import_export
ImportExport.export_category(category_id)
ImportExport.export_category(category_id, filename)
puts "", "Done", ""
end