Files
usaco/lib/cmd/done.sh
T
adamfandClaude Opus 5.5 1c647072c5
Test and publish the site / test (push) Successful in 4m29s
Test and publish the site / publish (push) Successful in 1m25s
Add usaco sync; track saved test outputs
The website commits too, so `usaco sync` pulls its edits before pushing.
tests/*.out were swallowed by the *.out rule; they are expected outputs
the site shows, so re-include them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 21:51:34 +01:00

12 lines
593 B
Bash

# usaco done <name>
[[ $# -ge 1 ]] || usage
name="$1"
[[ -d "$ROOT/solving/$name" ]] || { echo "Error: solving/$name not found" >&2; exit 1; }
[[ -d "$ROOT/solved/$name" ]] && { echo "Error: solved/$name already exists" >&2; exit 1; }
mv "$ROOT/solving/$name" "$ROOT/solved/$name"
echo "Moved to solved/$name 🎉"
if git -C "$ROOT" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
git -C "$ROOT" add -A "solved/$name" "solving/$name" 2>/dev/null || true
git -C "$ROOT" commit -m "Solve $name" >/dev/null && echo "Committed: Solve $name ${DIM}(usaco sync to publish it)${RST}"
fi