git init Arduino # create empty local repocd Arduinogit remote add origin https://github.com/arduino/Arduino.gitgit ls-remote --tags --refs | grep --regexp='refs/tags/[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*.*' | tail -1 | cut -d '/' -f 3 # get the last of a list all lightweight tags in semver format in the remote repo
Is there any way to download the latest Arduino IDE without explicitly specifying the version number?......Just trying ot make my script as fool proof as possible. If users don't have to specify the version, all the better.
This means that you don't care if there are different versions on those user's computers. I mean (as an example), you installed yesterday for a user and the latest version was 1.8.9 and you install today for another user and the latest version is 1.8.10. So now you have a user base that uses different versions. Not my cup-of-tea Personally, I would standardise on a specific version that's known to be OK; remember that newer is not always better. I did use 1.6.6 for a long time and upgraded to 1.8.5 a number of months after it became available and there were no massive issues.
EDIT: Runing the comand you provided returns 1.8.9 instead of 1.8.10 so I need to tweak the grep (or sort the output)
git ls-remote --quiet --tags --refs --sort=version:refname | grep --regexp='refs/tags/[0-9]\+\.[0-9]\+\.[0-9]\+\(\(-.*$\)\|$\)' | tail -1 | cut -d '/' -f 3 # get the last of a list of all lightweight tags in semver format in the remote repo