scripts: point latest.json to nightly.json when there are no tags
In case this script is run as part of the pipeline of an user that
forked the repository there may be no tags available. In this case, the
script aborts in versions[-1]
, as there are no versions collected.
Since this situation is expected for MRs, then point the latest.json
symlink to nightly.json
instead, since it is the "latest" version
available in such situation.
This does not affect the scheduled run of the web
job that runs for
the main repository, as in that case there are all the tags available.