#!/bin/sh
set -e
cd "$(dirname "$0")"
if [ ! -f ./.env ]; then
  echo "ERROR: ./.env not found in $(pwd)" >&2
  echo "Expected at least: CF_API_KEY=<your CurseForge token>" >&2
  exit 1
fi
set -a
. ./.env
set +a
status=0
./.release/release.sh "$@" || status=$?
if [ "$status" -eq 0 ]; then
  rm -f .release/*.zip
fi
exit "$status"
