~moviuro/factorio-dl

8cac9e32e81d964032101b5cf847377f61623b16 — Moviuro 5 months ago 526bada
factorio-dl: check for the dependencies
1 files changed, 6 insertions(+), 0 deletions(-)

M factorio-dl
M factorio-dl => factorio-dl +6 -0
@@ 94,6 94,12 @@ done

shift "$((OPTIND-1))"

for _dep in curl jq; do
  if ! command -v "$_dep" >/dev/null 2>&1; then
    __die "$_dep needed but not found!" 2
  fi
done

# Grab the username and token from the player-data.json file
if [ -r "$FACTORIO_PD" ]; then
  FACTORIO_TOKEN="$(jq -r '.["service-token"]' < "$FACTORIO_PD")"