Permalink
Browse files

add default host to dump

  • Loading branch information...
1 parent 33c99fe commit 83e52363df76c667bee270fa1f8a7a13a353d201 @ddollar committed May 22, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 init.rb
View
@@ -56,9 +56,10 @@ def env
def pg_dump_command(url)
uri = URI.parse(url)
database = uri.path[1..-1]
+ host = uri.host || "localhost"
port = uri.port || "5432"
user = uri.user ? "-U #{uri.user}" : ""
- %{ env PGPASSWORD=#{uri.password} pg_dump --verbose -F c -h #{uri.host} #{user} -p #{port} #{database} }
+ %{ env PGPASSWORD=#{uri.password} pg_dump --verbose -F c -h #{host} #{user} -p #{port} #{database} }
end
def pg_restore_command(url)

0 comments on commit 83e5236

Please sign in to comment.