From 9b81190220d58445883892215ce55556a5ca4a3c Mon Sep 17 00:00:00 2001 From: chiu Date: Fri, 14 Feb 2020 16:49:11 +0800 Subject: [PATCH] Update announcement.gemspec --- announcement.gemspec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/announcement.gemspec b/announcement.gemspec index fadf255..f895084 100644 --- a/announcement.gemspec +++ b/announcement.gemspec @@ -46,9 +46,12 @@ if old_gemfile_text != new_gemfile_text Bundler.with_clean_env do puts ENV['PWD'] puts mode - system("gem install bundler -v 1.17.3") - system("cd #{ENV['PWD']} \r\n mv -f Gemfile.lock Gemfile.lock.bak123 \r\n bundle update") - %x[kill -s TERM `cat tmp/pids/unicorn.pid` && bundle exec unicorn_rails -c config/unicorn.rb -D -E development] + 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") end end a.priority = 2