From 124ab392d1371069c5ac5ad84f7b209979186631 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 26 Feb 2020 16:11:03 +0800 Subject: [PATCH] fix git add log too large error --- temp_file/app/controllers/admin/sites_controller.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/temp_file/app/controllers/admin/sites_controller.rb b/temp_file/app/controllers/admin/sites_controller.rb index 91924a8..a341eeb 100644 --- a/temp_file/app/controllers/admin/sites_controller.rb +++ b/temp_file/app/controllers/admin/sites_controller.rb @@ -167,19 +167,19 @@ class Admin::SitesController < OrbitAdminController end git = 'git_1.9.1/usr/bin/git' end - git_add_except_public = Dir['*'].select{|v| v!= 'public'}.collect do |v| + git_add_except_public = Dir['*'].select{|v| v!= 'public' && v!= 'log'}.collect do |v| "#{git} add -f '#{v}'" end.join(' && ') - git_add_custom = (Dir['*'].select{|v| v !='app' && v != 'lib' && v != 'config' && v != 'public'} + ['app/templates','config/mongoid.yml']).collect do |v| + git_add_custom = (Dir['*'].select{|v| v !='app' && v != 'lib' && v != 'config' && v != 'public' && v!= 'log'} + ['app/templates','config/mongoid.yml']).collect do |v| "#{git} add -f --all '#{v}'" end.join(' && ') git_restore = "#{git} checkout ." time_now = Time.now.strftime('%Y_%m_%d_%H_%M') - if %x[git config user.name].empty? - %x[git config --global user.name "rulingcom"] + if %x[#{git} config user.name].empty? + %x[#{git} config --global user.name "rulingcom"] end - if %x[git config user.email].empty? - %x[git config --global user.email "orbit@rulingcom.com"] + if %x[#{git} config user.email].empty? + %x[#{git} config --global user.email "orbit@rulingcom.com"] end Bundler.with_clean_env{system("#{git_add_except_public} && #{git} commit -m auto_backup_before_#{type}_#{time_now} && #{git} reset #{commit} --mixed && #{git_add_custom} && #{git_restore} && #{git_add_except_public}&& #{git} commit -m complete_#{type}_#{time_now}")} mul.update_attributes(status: 'finish')