fix service by adding env variables to make update work properly (#80)

This commit is contained in:
Masoko
2024-02-11 15:51:56 +02:00
committed by GitHub
parent 35f15f9799
commit b36961fada
4 changed files with 20 additions and 9 deletions

View File

@@ -2,6 +2,7 @@ import ast
import os
import subprocess
import config
import logging
def get_assignments(filename):
with open(filename) as f:
@@ -54,9 +55,10 @@ def check_git_version_remote(script_dir):
result = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0].decode("utf-8")
except subprocess.CalledProcessError as e:
print("Error: {}".format(e))
return "0"
return config.version
latest_tag = result.strip()
logging.info("git update:" + result + script_dir)
return latest_tag if latest_tag else "0"