FIX: Ensure uploads directory exists.

This commit is contained in:
Guo Xiang Tan 2016-08-03 15:01:09 +08:00
parent 0a942dbc73
commit b860d1b254

View file

@ -230,10 +230,14 @@ module BackupRestore
log "Archiving uploads..."
FileUtils.cd(File.join(Rails.root, "public")) do
execute_command(
"tar --append --dereference --file #{tar_filename} #{upload_directory}",
"Failed to archive uploads."
)
if File.directory?(upload_directory)
execute_command(
"tar --append --dereference --file #{tar_filename} #{upload_directory}",
"Failed to archive uploads."
)
else
log "No uploads found, skipping archiving uploads..."
end
end
remove_tmp_directory