Spaces:
Running
Running
| SYNC := .claude/skills/sync-nowai-leaderboard/sync.mjs | |
| LOG := $(HOME)/Library/Logs/nowai-sync.log | |
| .PHONY: sync check logs push-to-prod force-push-to-prod | |
| sync: ## Run full sync (commit + push to staging) | |
| node $(SYNC) --push | |
| check: ## Dry-run: print diff, no writes | |
| node $(SYNC) --check | |
| logs: ## Show last 50 lines of the sync log | |
| tail -50 $(LOG) | |
| push-to-prod: ## Push current main to production after staging review | |
| @set -eu; \ | |
| if [ -n "$$(git status --short)" ]; then \ | |
| echo "Refusing to push to prod: working tree is not clean."; \ | |
| exit 1; \ | |
| fi; \ | |
| if [ "$$(git branch --show-current)" != "main" ]; then \ | |
| echo "Refusing to push to prod: current branch must be main."; \ | |
| exit 1; \ | |
| fi; \ | |
| if [ "$$(git rev-parse HEAD)" != "$$(git rev-parse origin/main)" ]; then \ | |
| echo "Refusing to push to prod: local HEAD must match origin/main."; \ | |
| exit 1; \ | |
| fi; \ | |
| echo "WARNING: this will push main to the production remote (prod)."; \ | |
| printf "Hit Enter or type Yes to continue: "; \ | |
| read answer; \ | |
| if [ -n "$$answer" ] && [ "$$answer" != "Yes" ]; then \ | |
| echo "Aborted."; \ | |
| exit 1; \ | |
| fi; \ | |
| git push prod main:main | |
| force-push-to-prod: ## Force-push current main to production after explicit confirmation | |
| @set -eu; \ | |
| echo "WARNING: this will force-push main to the production remote (prod)."; \ | |
| echo "Use this only when you intentionally need to override production history."; \ | |
| printf "Type Yes to continue: "; \ | |
| read answer; \ | |
| if [ "$$answer" != "Yes" ]; then \ | |
| echo "Aborted."; \ | |
| exit 1; \ | |
| fi; \ | |
| git push --force-with-lease prod main:main | |
| help: ## Display this help | |
| @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | |