diff --git a/temp_file/app/controllers/admin/sites_controller.rb b/temp_file/app/controllers/admin/sites_controller.rb index 91924a8..8861022 100644 --- a/temp_file/app/controllers/admin/sites_controller.rb +++ b/temp_file/app/controllers/admin/sites_controller.rb @@ -173,6 +173,9 @@ class Admin::SitesController < OrbitAdminController git_add_custom = (Dir['*'].select{|v| v !='app' && v != 'lib' && v != 'config' && v != 'public'} + ['app/templates','config/mongoid.yml']).collect do |v| "#{git} add -f --all '#{v}'" end.join(' && ') + git_add_all_program = (Dir['app/*'].select{|v| !v.include? 'templates'} + Dir['lib/*'] + Dir['config/*'].select{|v| !v.include? 'mongoid.yml'}).collect do |v| + "#{git} add -f '#{v}'" + end.join(' && ') git_restore = "#{git} checkout ." time_now = Time.now.strftime('%Y_%m_%d_%H_%M') if %x[git config user.name].empty? @@ -181,7 +184,7 @@ class Admin::SitesController < OrbitAdminController 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}")} + Bundler.with_clean_env{system("#{git_add_except_public} && #{git} commit -m auto_backup_before_#{type}_#{time_now} && #{git} reset #{commit} --mixed && #{git_add_all_program} && #{git} reset #{commit} --merge && #{git_add_custom} && #{git_restore} && #{git_add_except_public}&& #{git} commit -m complete_#{type}_#{time_now}")} mul.update_attributes(status: 'finish') end end