mirror of
https://github.com/github/codeql.git
synced 2025-12-16 08:43:11 +01:00
pick-kotlin-version.py: tolerate warnings
This commit changes pick-kotlin-version.py to use re.search() instead of re.match(), so that it can better cope with warning messages.
This commit is contained in:
@@ -26,7 +26,7 @@ if kotlinc is None:
|
||||
res = subprocess.run([kotlinc, "-version"], text=True, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
|
||||
if res.returncode != 0:
|
||||
raise Exception(f"kotlinc -version failed: {res.stderr}")
|
||||
m = re.match(r'.* kotlinc-jvm ([0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z][a-zA-Z0-9]*)?) .*', res.stderr)
|
||||
m = re.search(r' kotlinc-jvm ([0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z][a-zA-Z0-9]*)?) ', res.stderr)
|
||||
if m is None:
|
||||
raise Exception(f'Cannot detect version of kotlinc (got {res.stderr})')
|
||||
version = m[1]
|
||||
|
||||
Reference in New Issue
Block a user