mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
Merge pull request #5303 from vinothkannans/export-multiple-categories
FEATURE: Option to export multiple categories using export_category method
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user