diff --git a/lib/tasks/copy_site.rake b/lib/tasks/copy_site.rake index d278fbe..e42de3e 100644 --- a/lib/tasks/copy_site.rake +++ b/lib/tasks/copy_site.rake @@ -101,7 +101,7 @@ namespace :create_site do next if outputs.blank? if !outputs.include?("No such file or directory") read_lines = outputs.split("\n").map{|l| l.split('#').first} - include_path_lines = read_lines.select{|l| l.include?("path")} + include_path_lines = read_lines.select{|l| (l.include?("path") rescue false)} include_path_lines.each do |line| path = line.split(/[:>]/).last.gsub(/[\'\"]/,"").strip absolute_path = (path[0] == "/") ? path : ("#{template_site.path}/#{template_site.get_site_name}/#{path}") @@ -127,7 +127,7 @@ namespace :create_site do update_infos("finish execing bundle install") update_infos("starting #{args.site_name} web server to development") outputs = exec_ssh_command_by_sudo_for_create(ssh,"bash -l -c 'cd #{args.path}/#{@site_construct.get_site_name}\nkill -s TERM `fuser tmp/unicorn.sock`\nsudo -p \"sudo password:\" kill -s TERM `sudo -p \"sudo password:\" fuser tmp/unicorn.sock`\nsudo -p \"sudo password:\" rm -f tmp/pids/unicorn.pid\nbundle exec unicorn_rails -c config/unicorn.rb -D -E development\n'") - if outputs.include? "not writable" + if (outputs.include? "not writable" rescue false) exec_ssh_command_by_sudo_for_create(ssh,"sudo -p 'sudo password:' chown #{args.user}:#{args.user} #{args.path}/#{@site_construct.get_site_name} -R") exec_ssh_command_by_sudo_for_create(ssh,"sudo -p 'sudo password:' chmod 777 #{args.path}/#{@site_construct.get_site_name} -R") end