Commit 3583afcd authored by Victor Yacovlev's avatar Victor Yacovlev

Fixed TeamCity screened symbols

parent 9f844998
......@@ -18,25 +18,25 @@ def get_version_information(top_level_dir):
assert isinstance(top_level_dir, str) or isinstance(top_level_dir, unicode)
if os.path.exists(top_level_dir + os.path.sep + ".git"):
try:
version_info = subprocess.check_output(
version_info = to_str(subprocess.check_output(
"git describe --abbrev=0 --tags --exact-match",
shell=True,
stderr=subprocess.PIPE
).strip()
)).strip()
except subprocess.CalledProcessError:
version_info = subprocess.check_output(
version_info = to_str(subprocess.check_output(
"git rev-parse --abbrev-ref HEAD",
shell=True
).strip()
version_info += "-" + subprocess.check_output(
)).strip()
version_info += "-" + to_str(subprocess.check_output(
"git --no-pager log -1 --pretty=format:%H",
shell=True
).strip()
)).strip()
else:
dir_name = os.path.basename(top_level_dir)
match = re.match(r"kumir2-(.+)", dir_name)
version_info = match.group(1)
return to_str(version_info)
return version_info
def main():
......@@ -47,9 +47,9 @@ def main():
outfile = sys.stdout
for arg in sys.argv:
if arg.startswith("--prefix="):
prefix = unquote(arg[9:])
prefix = unquote(arg[9:].replace('@', '%'))
elif arg.startswith("--suffix="):
suffix = unquote(arg[9:])
suffix = unquote(arg[9:].replace('@', '%'))
elif arg.startswith("--out="):
outfile = open(arg[6:], 'w')
elif "--nl" == arg:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment