Skip to content

Commit

Permalink
ci: return none if there's no version. This will be done when the tes…
Browse files Browse the repository at this point in the history
…t is done in github actions
  • Loading branch information
dfguerrerom committed Jun 25, 2024
1 parent 9df5c2f commit ff7bfc7
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions component/scripts/gwb_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@

def get_gwb_version():
"""Get the version of GWB installed on the system and write it to CHANGELOG.md."""
# Run the command and capture output
result = subprocess.run(["GWB"], capture_output=True, text=True)
output = result.stdout.splitlines()

# Find and capture the version number
version = None
for line in output:
match = re.search(r"Installed version: (\d+\.\d+\.\d+)", line)
if match:
version = match.group(1)
break

try:
# Run the command and capture output
result = subprocess.run(["GWB"], capture_output=True, text=True)
output = result.stdout.splitlines()

# Find and capture the version number
version = None
for line in output:
match = re.search(r"Installed version: (\d+\.\d+\.\d+)", line)
if match:
version = match.group(1)
break

except Exception as e:
version = "There is no GWB installation on this system."
print(e)

return version or "There is no GWB installation on this system."

Expand Down

0 comments on commit ff7bfc7

Please sign in to comment.