lib/tasks/pg_pull.rake in effective_developer-0.6.12 vs lib/tasks/pg_pull.rake in effective_developer-0.6.13

- old
+ new

@@ -144,10 +144,10 @@ defaults = { database: nil, filename: (ENV['DATABASE'] || 'latest') + '.dump' } env_keys = { database: ENV['DATABASE'], filename: ENV['FILENAME'], logs: ENV['LOGS'] } keywords = ARGV.map { |a| a.split('=') if a.include?('=') }.compact.inject({}) { |h, (k, v)| h[k.to_sym] = v; h } args.with_defaults(defaults.compact.merge(env_keys.compact).merge(keywords)) - db = if ENV['DATABASE_URL'].to_s.length > 0 + db = if ENV['DATABASE_URL'].to_s.length > 0 && args.database.blank? uri = URI.parse(ENV['DATABASE_URL']) rescue nil abort("Invalid DATABASE_URL") unless uri.present? { username: uri.user, password: uri.password, host: uri.host, port: (uri.port || 5432), database: uri.path.sub('/', '') } else