#!/bin/bash

# set error handling
set -e
# configure repo url
REPO_URL="${REPO_URL:-https://raw.githubusercontent.com/eaannist/minidite/main}"
# check if curl is installed
command -v curl &>/dev/null || { echo "Error: curl required"; exit 1; }
# get version from repo/home/minidite-version
VERSION=$(curl -fsSL "${REPO_URL}/home/minidite-version")
# execute setup.sh from repo with version
exec curl -fsSL "${REPO_URL}/setup.sh" | VERSION=$VERSION bash
