Skip to content

Commit

Permalink
fix bug on update_package.py
Browse files Browse the repository at this point in the history
Update comments on update_package.py

add comments that help understand the issue that the latest sclauncher doesn't get updated. The version from the regex (current version) didn't include `v` however the function get_latest_version did include the `v`. The URL replaced the version without `v` (current version) with the latest version found that included the `v`, which resulted in the wrong URL `https://github.com/jstrosch/sclauncher/releases/download/vv0.0.6/sclauncher.exe`

Update scripts/utils/update_package.py

Co-authored-by: Ana María Martínez Gómez <[email protected]>

add comment
  • Loading branch information
sara-rn committed Nov 21, 2024
1 parent 0f526b9 commit 96a7c83
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/utils/update_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ def get_latest_version(org, project, version):
print(f"GitHub API response not ok: {response.status_code}")
return None
latest_version = response.json()["tag_name"]
return latest_version
# version excludes `v` from the capturing group in the regex in update_github_url therefore latest_version_match mustn't include `v` if the version starts with `v`. Otherwise the github URL would replace the version without the `v` with the github version tag with the `v` which will result in the wrong URL such as: https://github.com/jstrosch/sclauncher/releases/download/vv0.0.6/sclauncher.exe
if latest_version.startswith('v'):
return latest_version[1:]
else:
return latest_version


# Get url response's content hash (SHA256)
Expand Down

0 comments on commit 96a7c83

Please sign in to comment.