Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem: When using an index value to assume the position of the pre release release we want, we may get a wrong version, as happened when I built a custom version of 4.3.9 as a pre-release after the normal build process. This led to
release-4.4.3.1_v1.2.17
being downgraded torelease-4.3.9_v1.2.17
at the index position[0]
of the pre re was replaced by this new pre release.Solution: My releases provide a
dependency-version.json
as a released file which can cleanly let us know the specific version of qbittorrent on the latest release without any fancy or complicated checks. So we can quickly determine the release value we need to know to determine which pre release we want. So we set this to a variable like thisqbts_latest_release="$(curl -sL https://github.com/userdocs/qbittorrent-nox-static/releases/latest/download/dependency-version.json | jq -r '.qbittorrent')"
Using this version variable we can be more specific with
jq
about what we are looking for by returning the first result of a targeted search/filter value instead of looking at the index position[0]
If we don't filter the first result and see them all we get this, for example.
I think this is a better approach to determining the release value we want as it will ignore index value shifts and always produce a more targeted and relevant result.
It worked in my testing but I have not tested the build process itself so it needs double checking to make sure it solves the problem.