@giuspen commented on this pull request.
> + for line in f:
+ # Look for lines containing 'AC_INIT'
+ if 'AC_INIT' in line:
+ # Use a regular expression to find the pattern:
+ # AC_INIT([ProjectName], [Version], ...)
+ # We want to capture the content of the second square bracket
group.
+ # The regex looks for 'AC_INIT(', then '[anything]', then a comma
+ # and optional spaces, then captures '[Version]' into group 1.
+ match = re.search(r'AC_INIT\(\[[^\]]+],\s*\[([^\]]+)\].*', line)
+ if match:
+ VERSION = match.group(1)
+ print(f"GOT VERSION {VERSION} FROM {line}")
+ else:
+ print(f"!! FAILED TO GET VERSION FROM {line}")
+ break # Stop after finding the first AC_INIT line with a version
applied suggested improvement, thanks
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/4223#discussion_r2147367784
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany/pull/4223/review/[email protected]>