#!/usr/bin/env bash set -euo pipefail root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" work="$(mktemp -d)" trap 'rm -rf "$work"' EXIT native() { if command -v cygpath >/dev/null 2>&1; then cygpath -m "$1" else printf '%s' "$1" fi } repo="$work/repo" mkdir -p "$repo" "$work/tmp" "$root/tmp" tar -C "$root" -c \ --exclude=./bin --exclude=./web --exclude=./node_modules --exclude=./.git \ --exclude=./.task --exclude=./tmp --exclude=./data --exclude=./.claude \ --exclude=./internal/infrastructure/assets/dist --exclude='*.exe' --exclude='*.db' . | tar -C "$repo" -x export GOCACHE="$(native "$work/gocache")" export TEMP="$(native "$work/tmp")" export TMP="$TEMP" export TMPDIR="$TEMP" cd "$repo" code=0 gremlins unleash --integration --tags nofrontend --workers 4 \ --coverpkg=./internal/infrastructure/useCases/...,./api/middleware/...,./api/pkg/claims/... \ --timeout-coefficient 10 --output "$(native "$root/tmp/gremlins.json")" \ ./internal/infrastructure/useCases ./api/middleware ./api/pkg/claims || code=$? go clean -cache >/dev/null 2>&1 || true exit "$code"