Fix bug.
This commit is contained in:
parent
2082585e0c
commit
7d2cc811db
|
@ -52,9 +52,9 @@ module PersonalPluginGenerator
|
|||
end
|
||||
git = 'git_1.9.1/usr/bin/git'
|
||||
end
|
||||
@branch = %x(#{git} rev-parse --abbrev-ref HEAD).gsub("\n","")
|
||||
new_commit_id = %x(#{git} log #{@branch}..origin/#{@branch} --pretty=format:"%H")
|
||||
new_updates = %x(#{git} log #{@branch}..origin/#{@branch} --pretty=format:"%ad' , '%s" --date=short).split("\n").map{|log| log.gsub("'","")}
|
||||
@branch = %x(cd #{ENV['PWD']} && #{git} rev-parse --abbrev-ref HEAD).gsub("\n","")
|
||||
new_commit_id = %x(cd #{ENV['PWD']} && #{git} log #{@branch}..origin/#{@branch} --pretty=format:"%H")
|
||||
new_updates = %x(cd #{ENV['PWD']} && #{git} log #{@branch}..origin/#{@branch} --pretty=format:"%ad' , '%s" --date=short).split("\n").map{|log| log.gsub("'","")}
|
||||
if new_commit_id.present?
|
||||
git_add_except_public = Dir['*'].select{|v| v!= 'public' && v!= 'log' && v != 'dump' && v != 'tmp'}.collect do |v|
|
||||
"#{git} add -f --all --ignore-errors '#{v}'"
|
||||
|
@ -70,7 +70,7 @@ module PersonalPluginGenerator
|
|||
if %x[#{git} config user.email].empty?
|
||||
%x[#{git} config --global user.email "orbit@rulingcom.com"]
|
||||
end
|
||||
system("#{git_add_except_public} ; #{git} commit -m auto_backup_before_#{type}_#{time_now} --allow-empty && #{git} reset #{commit} --mixed ; #{git_add_custom} ; #{git_restore} ; #{git_add_except_public} ; #{git} clean -f -- app/models ; #{git} commit -m complete_#{type}_#{time_now} --allow-empty")
|
||||
system("cd #{ENV['PWD']} && sh -l -c \"#{git_add_except_public} ; #{git} commit -m auto_backup_before_#{type}_#{time_now} --allow-empty && #{git} reset #{commit} --mixed ; #{git_add_custom} ; #{git_restore} ; #{git_add_except_public} ; #{git} clean -f -- app/models ; #{git} commit -m complete_#{type}_#{time_now} --allow-empty\"")
|
||||
puts "Updated! " + new_updates.first.to_s
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue