#!/usr/bin/env bash
# Options: see /test/Database.hs (Main)

set -e

[ "${FLOCKER}" != "$0" ] && exec env FLOCKER="$0" flock -en .stack-work.lock "$0" "$@" || :

if ! in-develop | grep -q 'In develop'; then
    printf "Not in develop"
    exit 1
fi    

stack build --fast --flag uniworx:-library-only --flag uniworx:dev

export SERVER_SESSION_ACID_FALLBACK=${SERVER_SESSION_ACID_FALLBACK:-true}
stack exec uniworxdb -- $@
