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

CMD=${1:-run}

export RUST_LOG="budget=info"
export AUTH_SECRET="pMkW8PR7bjhc24bbvZLIEHfcooLzrGIh"
export DB_PATH="database.db"
export MOCK_MAILS="true"
export SECURE_COOKIES="false"
export SOCKET_ADDRESS="0.0.0.0:3000"

cargo-watch \
  --ignore README.md \
  --ignore bin \
  --ignore sql \
  --ignore database.db \
  --ignore database.db-shm \
  --ignore database.db-wal \
  --clear \
  -x "$CMD"