Files
functional-programming-snake/scripts/verify.sh
T
2026-10-28 23:34:21 +01:00

16 lines
678 B
Bash
Executable File

#!/usr/bin/env bash
# Usage: scripts/verify.sh <js|scala|fsharp>
# Copies the repo to a temp dir, swaps src/ for solutions/, runs the track's full test suite.
set -euo pipefail
track="${1:?usage: verify.sh <js|scala|fsharp>}"
case "$track" in js|scala|fsharp) ;; *) echo "unknown track: $track" >&2; exit 2;; esac
repo="$(cd "$(dirname "$0")/.." && pwd)"
tmp="$(mktemp -d)"
trap 'rm -rf "$tmp"' EXIT
tar -C "$repo" --exclude=.git --exclude=node_modules --exclude=bin --exclude=obj \
--exclude=.scala-build --exclude=.bsp --exclude=.superpowers -cf - . | tar -C "$tmp" -xf -
rm -rf "$tmp/$track/src"
cp -r "$tmp/$track/solutions" "$tmp/$track/src"
cd "$tmp/$track"
./test.sh