-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Description
Currently I must manually update the script after every IDE release to add that version to the list. It should be possible to automatically generate this list when the script is ran.
Options:
- Using git:
- The naive way would be to clone the repository, then run
git fetch --tags; git tagbut it's huge and you can't get tags from a shallow clone (which is still >100 MB anyway). - Luckily there is a better solution. Simply parse the output from
git ls-remote:git init Arduino # create empty local repo cd Arduino git remote add origin https://github.com/arduino/Arduino.git git ls-remote --tags --refs | grep --regexp='refs/tags/[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*.*' | cut -d '/' -f 3 # get the last of a list all lightweight tags in semver format in the remote repo
- The naive way would be to clone the repository, then run
- Using GitHub API: https://stackoverflow.com/a/32342630
I will need to exclude the tags that are not compatible with the script:
- <1.5.2: No CLI
- 1.6.2: Has the nasty behavior of moving the included hardware cores to the .arduino15 folder, causing those versions to be used for all builds after Arduino IDE 1.6.2 is used.
- Allow use of 1.6.2 if it's explicitly specified (rather than just a version range) but print a warning.
- Support the "hourly" IDE version name, even though there is no tag for it.
The downside to this is that it means the script is dependent on an Internet connection.
- Can the script be made to not require the available version list if a version or version list rather than range is passed as the argument to
install_ide? - I could allow the user to define an environment variable with their own version list, which is used as a fallback if the automatic list generation fails.