#!/bin/bash

app_config=$HOME/.edps/application.properties
log_config=$HOME/.edps/logging.yaml

if ! command -v edps >/dev/null 2>&1; then
  echo "edps command not found in PATH"
  exit 1
fi

if [ ! -f "$app_config" ] || [ ! -f "$log_config" ]; then
  edps
fi

app_dir=$(python -c "import edpsgui as _; print(_.__path__[0])")

panel serve "$app_dir"/edps-gui.py --show --plugins edpsgui.pdf_handler "$@"
