discourse/lib/tasks/export.rake

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
806 B
Ruby
Raw Normal View History

# frozen_string_literal: true
desc 'Export all the categories'
task 'export:categories', [:category_ids] => [:environment] do |_, args|
require "import_export"
ids = args[:category_ids].split(" ")
2018-05-28 21:51:06 +08:00
ImportExport.export_categories(ids)
puts "", "Done", ""
end
desc 'Export only the structure of all categories'
task 'export:category_structure', [:include_group_users, :file_name] => [:environment] do |_, args|
require "import_export"
ImportExport.export_category_structure(args[:include_group_users], args[:file_name])
puts "", "Done", ""
end
desc 'Export all user groups'
task 'export:groups', [:include_group_users, :file_name] => [:environment] do |_, args|
require "import_export"
ImportExport.export_groups(args[:include_group_users], args[:file_name])
puts "", "Done", ""
end