fix store problem

This commit is contained in:
chiu 2020-02-21 19:38:12 +08:00
parent 0f9129ba7b
commit f9eb64bc72
1 changed files with 4 additions and 1 deletions

View File

@ -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