diff --git a/lib/import_export/import_export.rb b/lib/import_export/import_export.rb index 715a4bea5e5..4bb6fa9250d 100644 --- a/lib/import_export/import_export.rb +++ b/lib/import_export/import_export.rb @@ -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) diff --git a/script/discourse b/script/discourse index fb91f986f4f..af03de89b35 100755 --- a/script/discourse +++ b/script/discourse @@ -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