Skip to content

Commit

Permalink
improve url building for dump filename
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrock committed Oct 9, 2018
1 parent 8f764cb commit dbf2ada
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/evm_database_ops.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,11 @@ def self.restore(db_opts, connect_opts = {})
uri = connect_opts[:uri]
connect_opts[:uri] = File.dirname(connect_opts[:uri])
else
uri_parts = [connect_opts[:uri]]
uri_parts << (action == :dump ? "db_dump" : "db_backup") unless connect_opts[:skip_directory]
connect_opts[:remote_file_name] ||= File.basename(backup_file_name(action))
backup_folder = if connect_opts[:skip_directory]
[]
elsif action == :dump
"db_dump"
else
"db_backup"
end
uri = File.join(connect_opts[:uri], backup_folder, connect_opts[:remote_file_name])
uri_parts << connect_opts[:remote_file_name]
uri = File.join(uri_parts)
end
else
uri = db_opts[:local_file]
Expand Down

0 comments on commit dbf2ada

Please sign in to comment.