Improve the script for creating download links

— factorize the two scripts into a single one
— various safety and style improvements
1 job for master in 10 seconds (queued for 2 seconds)
Status Job ID Name Coverage
  Build
failed #5748
build

00:00:10

 
Name Stage Failure
failed
build Build
2019-09-04 13:07:35 URL:https://www.dynare.org/snapshot/windows.json [847/847] -> "windows.json" [1]
+ wget --no-verbose https://www.dynare.org/snapshot/windows-zip.json
2019-09-04 13:07:35 URL:https://www.dynare.org/snapshot/windows-zip.json [847/847] -> "windows-zip.json" [1]
+ arr=("macosx" "source" "windows" "windows-zip")
+ for dir in "${arr[@]}"
+ mkdir -p macosx
+ read -ra filenames
++ jq '.[].filename' macosx.json
ERROR: Job failed: exit status 1