#!/usr/bin/env bash
# A small wrapper to make download_assets from the build script usable
# via a source service.

while test $# -gt 0; do
  case $1 in
    --outdir)
      MYOUTDIR="$2"
      shift
    ;;
    *)
      echo "Unknown parameter $1."
      echo "This service is not accepting parameters currently."
      exit 1
    ;;
  esac
  shift
done

if [[ ! -d "${MYOUTDIR}" ]]; then
  echo "ERROR: output directory \"${MYOUTDIR}\" does not exist"
  exit 1
fi

exec /usr/lib/build/download_assets --outdir "$MYOUTDIR" .

