From 7b3afcaf77f96e7d62f6cd1623ead7f17512d79f Mon Sep 17 00:00:00 2001 From: Omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Sat, 24 Feb 2024 22:47:46 +1100 Subject: repo init. partial port of existing code --- deps/Unity/auto/extract_version.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 deps/Unity/auto/extract_version.py (limited to 'deps/Unity/auto/extract_version.py') diff --git a/deps/Unity/auto/extract_version.py b/deps/Unity/auto/extract_version.py new file mode 100755 index 0000000..1d137e5 --- /dev/null +++ b/deps/Unity/auto/extract_version.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 +import re +import sys + +ver_re = re.compile(r"^#define\s+UNITY_VERSION_(?:MAJOR|MINOR|BUILD)\s+(\d+)$") +version = [] + +with open(sys.argv[1], "r") as f: + for line in f: + m = ver_re.match(line) + if m: + version.append(m.group(1)) + +print(".".join(version)) + -- cgit v1.2.3-70-g09d2