#!/usr/bin/env bash set -euo pipefail ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" if [[ -f "${ROOT_DIR}/.env" ]]; then set -a # shellcheck disable=SC1091 source "${ROOT_DIR}/.env" set +a fi BACKEND_ENV="${SEG_BACKEND_CONDA_ENV:-seg_smp}" HOST="${SEG_BACKEND_HOST:-0.0.0.0}" PORT="${SEG_BACKEND_PORT:-8010}" RELOAD="${SEG_BACKEND_RELOAD:-1}" cd "${ROOT_DIR}" args=(uvicorn app.main:app --app-dir backend --host "${HOST}" --port "${PORT}") case "${RELOAD,,}" in 1|true|yes|on) args+=(--reload) ;; esac exec conda run -n "${BACKEND_ENV}" "${args[@]}"