#!/usr/bin/env bash # Usage: scripts/verify.sh # 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 }" 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