From 6161a1a0040d69f9e656092bb51f8c20256a2da2 Mon Sep 17 00:00:00 2001 From: Bohung Date: Fri, 14 Jan 2022 11:40:20 +0800 Subject: [PATCH] Fix bug. --- lib/tasks/copy_site.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/copy_site.rake b/lib/tasks/copy_site.rake index e9fc626..e34d8cd 100644 --- a/lib/tasks/copy_site.rake +++ b/lib/tasks/copy_site.rake @@ -67,7 +67,7 @@ namespace :create_site do exec_ssh_command_by_sudo_for_create(ssh,"sudo -p 'sudo password:' chmod 777 #{args.path}/#{@site_construct.get_site_name} -R") db_setting_text = ssh.exec!("cat #{args.path}/#{args.site_name}/config/mongoid.yml") update_infos("setting dbname to #{args.db_name}") - exec_ssh_command_by_sudo_for_create(ssh,"sh -c \"echo '#{db_setting_text.gsub(template_site.db_name,args.db_name)}' > #{args.path}/#{@site_construct.get_site_name}/config/mongoid.yml\"",true) + exec_ssh_command_by_sudo_for_create(ssh,"sh -c \"echo '#{db_setting_text.gsub(/database: .+/,"database: "+args.db_name)}' > #{args.path}/#{@site_construct.get_site_name}/config/mongoid.yml\"",true) unless args.only_copy_installed_module == true || args.only_copy_installed_module == "true" update_infos("copying db from #{template_site.db_name} to #{args.db_name}") if @site_construct.server_type == template_site.server_type