From 27e3a1408e2e95d117aee4ad82373b7a508e17cb Mon Sep 17 00:00:00 2001 From: chiu Date: Fri, 14 Feb 2020 16:51:02 +0800 Subject: [PATCH] Update announcement.gemspec --- announcement.gemspec | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/announcement.gemspec b/announcement.gemspec index f895084..1dfafae 100644 --- a/announcement.gemspec +++ b/announcement.gemspec @@ -42,20 +42,21 @@ if old_gemfile_text != new_gemfile_text else mode = 'production' end + if Dir[ENV['PWD']+'/Gemfile.lock'].blank? + command = "gem install bundler -v 1.17.3 && cd #{ENV['PWD']} \r\n bundle update \r\n" + else + command = "gem install bundler -v 1.17.3 && cd #{ENV['PWD']} \r\n mv -f Gemfile.lock Gemfile.lock.bak123 \r\n bundle update \r\n" + end + all_command = "#{command} kill -s TERM `cat tmp/pids/unicorn.pid` && bundle exec unicorn_rails -c config/unicorn.rb -D -E development" a = Thread.start do Bundler.with_clean_env do puts ENV['PWD'] puts mode - if Dir[ENV['PWD']+'/Gemfile.lock'].blank? - command = "gem install bundler -v 1.17.3 && cd #{ENV['PWD']} \r\n bundle update \r\n" - else - command = "gem install bundler -v 1.17.3 && cd #{ENV['PWD']} \r\n mv -f Gemfile.lock Gemfile.lock.bak123 \r\n bundle update \r\n" - end - system("#{command} kill -s TERM `cat tmp/pids/unicorn.pid` && bundle exec unicorn_rails -c config/unicorn.rb -D -E development") + system(all_command) end end a.priority = 2 - sleep 1 + sleep 2 a.run Thread.kill(Thread.current) puts '123'