~moviuro/factorio-dl

a4a6806689d84bf5070cf29ec69bcf1543718986 — Moviuro 10 months ago 6f4d05b
factorio-dl: remove redundant code (version number grabbing from API)
1 files changed, 4 insertions(+), 10 deletions(-)

M factorio-dl
M factorio-dl => factorio-dl +4 -10
@@ 181,17 181,11 @@ fi
version="${1#"factorio://"}"
_latest_json="https://factorio.com/api/latest-releases"
case "$version" in
  ""|experimental)
    __warn "Trying $_latest_json for experimental, might be broken"
  ""|experimental|stable)
    : "${version:="experimental"}"
    __warn "Trying $_latest_json for $version, might be broken"
    version="$(curl -s "${_latest_json}" |
     jq -rc '.experimental.alpha'
    )"
    __warn "Got $version"
    ;;
  stable)
    __warn "Trying $_latest_json for stable, might be broken"
    version="$(curl -s "${_latest_json}" |
     jq -rc '.stable.alpha'
     jq -rc ".$version.alpha"
    )"
    __warn "Got $version"
    ;;