diff --git a/scripts/test.sh b/scripts/test.sh index 35fa783..b40025d 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -21,9 +21,9 @@ if [ -n "${EXTRA_PATH:-}" ]; then export PATH="$EXTRA_PATH:$PATH" fi -# Stack detection (runtime, mode-agnostic) -HAS_BACKEND=0; [ -d backend ] && HAS_BACKEND=1 -HAS_FRONTEND=0; [ -d frontend ] && HAS_FRONTEND=1 +# Stack detection: tracked content only — untracked WIP must not gate pushes +HAS_BACKEND=0; [ -d backend ] && [ -n "$(git ls-files -- backend 2>/dev/null)" ] && HAS_BACKEND=1 +HAS_FRONTEND=0; [ -d frontend ] && [ -n "$(git ls-files -- frontend 2>/dev/null)" ] && HAS_FRONTEND=1 if [ $HAS_BACKEND -eq 0 ] && [ $HAS_FRONTEND -eq 0 ]; then echo "[test.sh] FATAL: neither backend/ nor frontend/ exists" >&2 exit 1