Skip to content

Commit

Permalink
Set staging_domain to a blank string if it is falsey
Browse files Browse the repository at this point in the history
  • Loading branch information
markjaquith committed Aug 18, 2012
1 parent 9e032bf commit 5711e45
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/tasks.rb
Expand Up @@ -68,6 +68,7 @@
end end
desc "Sets the database credentials (and other settings) in wp-config.php" desc "Sets the database credentials (and other settings) in wp-config.php"
task :make_config do task :make_config do
staging_domain ||= ''
{:'%%WP_STAGING_DOMAIN%%' => staging_domain, :'%%WP_STAGE%%' => stage, :'%%DB_NAME%%' => wpdb[stage][:name], :'%%DB_USER%%' => wpdb[stage][:user], :'%%DB_PASSWORD%%' => wpdb[stage][:password], :'%%DB_HOST%%' => wpdb[stage][:host]}.each do |k,v| {:'%%WP_STAGING_DOMAIN%%' => staging_domain, :'%%WP_STAGE%%' => stage, :'%%DB_NAME%%' => wpdb[stage][:name], :'%%DB_USER%%' => wpdb[stage][:user], :'%%DB_PASSWORD%%' => wpdb[stage][:password], :'%%DB_HOST%%' => wpdb[stage][:host]}.each do |k,v|
run "sed -i 's/#{k}/#{v}/' #{release_path}/wp-config.php", :roles => :web run "sed -i 's/#{k}/#{v}/' #{release_path}/wp-config.php", :roles => :web
end end
Expand Down

0 comments on commit 5711e45

Please sign in to comment.