auto input git name and email if not existed

This commit is contained in:
chiu 2020-02-20 17:56:19 +08:00
parent ae2735fb5f
commit cef19ae494
1 changed files with 6 additions and 0 deletions

View File

@ -174,6 +174,12 @@ class Admin::SitesController < OrbitAdminController
"#{git} add -f '#{v}'" "#{git} add -f '#{v}'"
end.join(' && ') end.join(' && ')
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?
%x[git config --global user.name "rulingcom"]
end
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_all_program} && #{git} reset #{commit} --merge && #{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_except_public}&& #{git} commit -m complete_#{type}_#{time_now}")}
mul.update_attributes(status: 'finish') mul.update_attributes(status: 'finish')
end end