Commit d43028d2 authored by Eric Duminil's avatar Eric Duminil
Browse files

Allow / in version name

e.g. "experimental/blabla"
parent dbf055af
......@@ -11,7 +11,7 @@ from .utils import chdir
def cmd_info(args: argparse.Namespace) -> None:
from .runner import get_simstadt_folder, get_simstadt_output, _simstadt_script
from .runner import get_simstadt_folder, get_simstadt_output, _simstadt_script, SIMSTADT_VERSION_FORMAT
try:
folder = get_simstadt_folder()
......@@ -31,9 +31,10 @@ def cmd_info(args: argparse.Namespace) -> None:
print(f"SimStadt folder : {folder}")
output = get_simstadt_output(folder)
m = re.search(r"Launching SimStadt (\S+) \((\w+), rev\. (\w+), (\d\d\d\d)(\d\d)(\d\d)\)", output)
m = re.search(f"Launching SimStadt {SIMSTADT_VERSION_FORMAT}", output)
if m:
version, branch, commit, yyyy, mm, dd = m.groups()
version, branch, commit, date = m.groups()
yyyy, mm, dd = date[:4], date[4:6], date[6:8]
print(f"SimStadt version: {version} (branch: {branch}, rev: {commit}, date: {yyyy}-{mm}-{dd})")
else:
print("SimStadt version: unknown (could not parse version string)")
......
......@@ -26,7 +26,7 @@ from .utils import chdir, random_id
PARAMS = "params.xml"
SIMSTADT2_GLOB = "SimStadt2_0.*/"
SIMSTADT_TEMP_REPO = Path(tempfile.gettempdir()) / "simstadt_repo"
SIMSTADT_VERSION_FORMAT = r"(\S+)\s*\((\w+), rev. (\w+), (\d+)\s*\)"
SIMSTADT_VERSION_FORMAT = r"(\S+)\s*\(([\w/]+), rev. (\w+), (\d+)\s*\)"
load_dotenv()
......
Supports Markdown
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