fix old git compatibility issue
This commit is contained in:
@@ -145,8 +145,12 @@ def get_manufacturer():
|
|||||||
def check_git_update():
|
def check_git_update():
|
||||||
script_dir = os.path.dirname(os.path.realpath(__file__))
|
script_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
full_cmd = "git -C {} remote update && git -C {} status -uno".format(script_dir, script_dir)
|
full_cmd = "git -C {} remote update && git -C {} status -uno".format(script_dir, script_dir)
|
||||||
git_update = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0].decode("utf-8")
|
try:
|
||||||
if 'Your branch is up to date' in git_update:
|
git_update = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0].decode("utf-8")
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
print("Error updating git repository:", e.output)
|
||||||
|
|
||||||
|
if any(s in git_update for s in ('Your branch is up to date', 'Your branch is up-to-date')):
|
||||||
git_update = 'off'
|
git_update = 'off'
|
||||||
else:
|
else:
|
||||||
git_update = 'on'
|
git_update = 'on'
|
||||||
|
|||||||
Reference in New Issue
Block a user