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']