Add support for --version and -v options to display the current version of the app
Add version control so that when a new version is uploaded, prevent the apps from running and prompt the users to update the app before proceeding
Allow the app to run without the required TARGET argument only when specific flags are enabled (i.e. -v)
Requirements
You need to create a new tag for the desired versions
For example, when pushing version 0.4.3 you should create the tag v0.4.3
This can be done for each uploaded version or for crucial versions that contain significant changes or important bug fixes
The tags don't need to be annotated. You can use lightweight tags.
The commands to create a tag at the latest commit are:
git tag v0.4.3
git push origin v0.4.3
To delete a tag run:
git tag -d v0.4.3
git push origin :refs/tags/v0.4.3
Implementation
The idea is that we get the latest available version using the Github API to access the metadata of the srcup repo. The repo is public, so no further authorization is needed to get that information
We get the current version of the installed app and we compare the two versions allowing any version greater than the latest tag to be used
This allows us to not block the app on every update, but when an important change is published and we want all the users to upgrade before proceeding, then we can bump the tag version as well and enforce them to update
Changes
--version
and-v
options to display the current version of the appTARGET
argument only when specific flags are enabled (i.e.-v
)Requirements
You need to create a new tag for the desired versions
0.4.3
you should create the tagv0.4.3
The tags don't need to be annotated. You can use lightweight tags. The commands to create a tag at the latest commit are:
git tag v0.4.3
git push origin v0.4.3
To delete a tag run:
git tag -d v0.4.3
git push origin :refs/tags/v0.4.3
Implementation
The idea is that we get the latest available version using the Github API to access the metadata of the
srcup
repo. The repo is public, so no further authorization is needed to get that informationWe get the current version of the installed app and we compare the two versions allowing any version greater than the latest tag to be used