|
@@ -24,6 +24,20 @@ class AutoCommit(object):
|
|
|
print(f"{bcolors.OKGREEN} commit finish{bcolors.ENDC}")
|
|
|
# os.chdir(work_dir)
|
|
|
|
|
|
+ def _check(self, path):
|
|
|
+ """ git status """
|
|
|
+ os.chdir(path)
|
|
|
+ print(f"{bcolors.OKGREEN} checking {path}{bcolors.ENDC}")
|
|
|
+ os.system("git status")
|
|
|
+ # with os.popen("git status") as p:
|
|
|
+ # output = p.read()
|
|
|
+ # resData = re.split("\n", output)
|
|
|
+ # if len(resData) > 2:
|
|
|
+ # print(f"{bcolors.FAIL} check error: {resData} {bcolors.ENDC}")
|
|
|
+ # exit(1)
|
|
|
+ # print(f"{bcolors.OKGREEN} check finish{bcolors.ENDC}")
|
|
|
+ # os.chdir(work_dir)
|
|
|
+
|
|
|
def _sync(self, path):
|
|
|
""" git pull """
|
|
|
os.chdir(path)
|
|
@@ -33,6 +47,17 @@ class AutoCommit(object):
|
|
|
print(f"{bcolors.OKGREEN} sync finish{bcolors.ENDC}")
|
|
|
# os.chdir(work_dir)
|
|
|
|
|
|
+ def check(self):
|
|
|
+ """ check project update"""
|
|
|
+ if ".git" in os.listdir(self.params['path']):
|
|
|
+ self._check(self.params['path'])
|
|
|
+ else:
|
|
|
+ for root, dirs, files in os.walk(self.params['path']):
|
|
|
+ if ".git" in dirs:
|
|
|
+ self._check(root)
|
|
|
+ os.system("pause")
|
|
|
+
|
|
|
+
|
|
|
def commit(self):
|
|
|
""" run """
|
|
|
if ".git" in os.listdir(self.params['path']):
|