Merge pull request #5303 from vinothkannans/export-multiple-categories

FEATURE: Option to export multiple categories using export_category method
This commit is contained in:
Neil Lalonde
2017-11-15 16:07:21 -05:00
committed by GitHub
5 changed files with 38 additions and 22 deletions

View File

@ -181,16 +181,22 @@ class DiscourseCLI < Thor
puts 'Requests sent. Clients will refresh on next navigation.'
end
desc "export_category", "Export a category, all its topics, and all users who posted in those topics"
def export_category(category_id, filename = nil)
raise "Category id argument is missing!" unless category_id
desc "export_categories", "Export categories, all its topics, and all users who posted in those topics"
def export_categories(*category_ids)
puts "Starting export of categories...", ""
load_rails
load_import_export
ImportExport.export_category(category_id, filename)
ImportExport.export_categories(category_ids)
puts "", "Done", ""
end
desc "export_category", "Export a category, all its topics, and all users who posted in those topics"
def export_category(category_id)
raise "Category id argument is missing!" unless category_id
export_categories([category_id])
end
desc "import_category", "Import a category, its topics and the users from the output of the export_category command"
def import_category(filename)
raise "File name argument missing!" unless filename