fix old git compatibility issue
This commit is contained in:
@@ -163,14 +163,10 @@ def check_git_version():
|
|||||||
|
|
||||||
def check_git_version_remote():
|
def check_git_version_remote():
|
||||||
script_dir = os.path.dirname(os.path.realpath(__file__))
|
script_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
cmd = ['git', '-C', script_dir, 'ls-remote', '--tags', '--sort=-version:refname']
|
full_cmd = "git -C {} ls-remote --tags origin | awk -F'/' '{{print $3}}' | sort -V | tail -n 1".format(script_dir)
|
||||||
result = subprocess.run(cmd, capture_output=True, universal_newlines=True)
|
result = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0].decode("utf-8")
|
||||||
lines = result.stdout.splitlines()
|
latest_tag = result.strip()
|
||||||
if lines:
|
return latest_tag if latest_tag else None
|
||||||
latest_tag = lines[0].split('/')[-1]
|
|
||||||
return latest_tag
|
|
||||||
else:
|
|
||||||
return None
|
|
||||||
|
|
||||||
def get_network_ip():
|
def get_network_ip():
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||||
|
|||||||
Reference in New Issue
Block a user