Method: GGSM::Submodule#check_un_commit_code

Defined in:
lib/ggsm/util/submodule.rb

#check_un_commit_codeObject



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/ggsm/util/submodule.rb', line 101

def check_un_commit_code
  subs = get_submodule
  project_path = Dir.pwd
  subs.each do |sub|
    Dir.chdir sub
    status = `git status --ignore-submodules | grep 'nothing to commit'`
    if status.strip == ''
      puts "#{sub} 有未提交的代码".red
      exit 1
    end
    Dir.chdir project_path
  end

  status = `git status --ignore-submodules | grep 'nothing to commit'`
  if status.strip == ''
    puts '主工程 有未提交的代码'.red
    exit 1
  end
end