mirror of
https://github.com/discourse/discourse.git
synced 2025-06-20 09:51:37 +08:00
FIX: Backup script with custom filename needs to include version number.
This commit is contained in:
@ -41,6 +41,9 @@ class DiscourseCLI < Thor
|
|||||||
backup = backuper.run
|
backup = backuper.run
|
||||||
if filename.present?
|
if filename.present?
|
||||||
puts "Moving '#{backup}' to '#{filename}'"
|
puts "Moving '#{backup}' to '#{filename}'"
|
||||||
|
puts "Including version number into '#{filename}'"
|
||||||
|
version_string = File.basename(backup)[/-#{BackupRestore::VERSION_PREFIX}\d{14}/]
|
||||||
|
filename = filename.dup.insert(filename.index('.'), version_string)
|
||||||
FileUtils.mv(backup, filename)
|
FileUtils.mv(backup, filename)
|
||||||
backup = filename
|
backup = filename
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user