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]>
This commit is contained in:
+1
-1
@@ -7,5 +7,5 @@ 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"
|
||||
git -C "$ROOT" commit -m "Solve $name" >/dev/null && echo "Committed: Solve $name ${DIM}(usaco sync to publish it)${RST}"
|
||||
fi
|
||||
|
||||
@@ -10,7 +10,7 @@ HISTFILE="$ROOT/.usaco_history"
|
||||
# commands that take a problem name (the selection is injected when you omit it)
|
||||
WITH_PROBLEM="run build test done undo skip io cat copy edit open path template reset"
|
||||
# commands that take no problem
|
||||
NO_PROBLEM="list stats clean"
|
||||
NO_PROBLEM="list stats clean sync"
|
||||
# REPL-only words (used for completion and for 'help')
|
||||
REPL_WORDS="s use none push pop stack help quit exit"
|
||||
|
||||
@@ -144,7 +144,7 @@ while :; do
|
||||
case "$c" in
|
||||
r) c=run ;; b) c=build ;; t) c=test ;; d) c=done ;; u) c=undo ;; sk) c=skip ;;
|
||||
e|vim) c=edit ;; o) c=open ;; l|ls) c=list ;; st) c=stats ;; p) c=path ;;
|
||||
tpl) c=template ;; rm|delete) c=reset ;; cp) c=copy ;;
|
||||
tpl) c=template ;; rm|delete) c=reset ;; cp) c=copy ;; sy) c=sync ;;
|
||||
esac
|
||||
|
||||
if [[ " $NO_PROBLEM " == *" $c "* ]]; then
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
# usaco sync
|
||||
# Pull what the website committed (status changes, links, notes), then push local
|
||||
# commits so the site shows them. --autostash keeps uncommitted work in solving/.
|
||||
git -C "$ROOT" pull --rebase --autostash && git -C "$ROOT" push
|
||||
Reference in New Issue
Block a user