Skip to content

Commit

Permalink
Merge pull request #10 from openteam/set-username-only-if-necessary
Browse files Browse the repository at this point in the history
do not use -U username if username not specified
  • Loading branch information
sgruhier committed Apr 6, 2013
2 parents d8d030f + 50497a9 commit 229c2a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/capistrano-db-tasks/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ def postgresql?

def credentials
if mysql?
" -u #{@config['username']} " + (@config['password'] ? " -p\"#{@config['password']}\" " : '') + (@config['host'] ? " -h #{@config['host']}" : '') + (@config['socket'] ? " -S#{@config['socket']}" : '')
(@config['username'] ? " -u #{@config['username']} " : '') + (@config['password'] ? " -p\"#{@config['password']}\" " : '') + (@config['host'] ? " -h #{@config['host']}" : '') + (@config['socket'] ? " -S#{@config['socket']}" : '')
elsif postgresql?
" -U #{@config['username']} " + (@config['host'] ? " -h #{@config['host']}" : '')
(@config['username'] ? " -U #{@config['username']} " : '') + (@config['host'] ? " -h #{@config['host']}" : '')
end
end

Expand Down

0 comments on commit 229c2a6

Please sign in to comment.