File size: 1,748 Bytes
0bc5d1a
 
 
e82a5f2
0bc5d1a
e82a5f2
0bc5d1a
 
e82a5f2
0bc5d1a
 
e82a5f2
0bc5d1a
e82a5f2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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}'