From db812a616ef0585ed0740903a130dac82dc945f2 Mon Sep 17 00:00:00 2001 From: chiu Date: Fri, 14 Feb 2020 16:22:49 +0800 Subject: [PATCH] Update announcement.gemspec --- announcement.gemspec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/announcement.gemspec b/announcement.gemspec index 5c54371..dbb3808 100644 --- a/announcement.gemspec +++ b/announcement.gemspec @@ -35,7 +35,13 @@ if old_gemfile_text != new_gemfile_text File.open(ENV['PWD']+'/Gemfile', 'w') do |file| file.write new_gemfile_text end - mode = Rails.env.inspect + log_development = File.mtime(ENV['PWD']+'/log/development.log').strftime('%Y%m%d%H%M').to_i rescue 0 + log_production = File.mtime(ENV['PWD']+'/log/production.log').strftime('%Y%m%d%H%M').to_i rescue 0 + if log_development > log_production + mode = 'development' + else + mode = 'production' + end a = Thread.start do Bundler.with_clean_env do puts ENV['PWD']