Provide hints about which files can be restored

This commit is contained in:
Robin Ward 2016-07-12 12:30:39 -04:00
parent 5915929166
commit c2b769bd95
1 changed files with 12 additions and 1 deletions

View File

@ -56,7 +56,18 @@ class DiscourseCLI < Thor
end
desc "restore", "Restore a Discourse backup"
def restore(filename)
def restore(filename=nil)
if !filename
puts "You must provide a filename to restore. Did you mean one of the following?\n\n"
Dir["public/backups/default/*"].each do |f|
puts "script/discourse restore #{File.basename(f)}"
end
return
end
load_rails
require "backup_restore/backup_restore"
require "backup_restore/restorer"