fix git add log too large error

This commit is contained in:
chiu 2020-02-26 16:11:03 +08:00
parent d9417bc15c
commit 124ab392d1
1 changed files with 6 additions and 6 deletions

View File

@ -167,19 +167,19 @@ class Admin::SitesController < OrbitAdminController
end end
git = 'git_1.9.1/usr/bin/git' git = 'git_1.9.1/usr/bin/git'
end 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}'" "#{git} add -f '#{v}'"
end.join(' && ') 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}'" "#{git} add -f --all '#{v}'"
end.join(' && ') end.join(' && ')
git_restore = "#{git} checkout ." git_restore = "#{git} checkout ."
time_now = Time.now.strftime('%Y_%m_%d_%H_%M') time_now = Time.now.strftime('%Y_%m_%d_%H_%M')
if %x[git config user.name].empty? if %x[#{git} config user.name].empty?
%x[git config --global user.name "rulingcom"] %x[#{git} config --global user.name "rulingcom"]
end end
if %x[git config user.email].empty? if %x[#{git} config user.email].empty?
%x[git config --global user.email "orbit@rulingcom.com"] %x[#{git} config --global user.email "orbit@rulingcom.com"]
end 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}")} 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') mul.update_attributes(status: 'finish')