#!/usr/bin/env bash
set -Eeuo pipefail
cd "$(dirname "$0")"

if [ ! -d node_modules ]; then
  npm install
fi
if [ ! -f .env ]; then
  cp .env.example .env
  echo "Created .env. Add marketplace credentials there when ready."
fi
if [ ! -f dist/index.html ]; then
  npm run build
fi
exec npm start
