-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
35 lines (33 loc) · 920 Bytes
/
Makefile
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
.PHONY: watch build
dev:
@if command -v $(HOME)/go/bin/air > /dev/null; then \
AIR_CMD="$(HOME)/go/bin/air"; \
elif command -v air > /dev/null; then \
AIR_CMD="air"; \
else \
read -p "air is not installed. Install it? [Y/n] " choice; \
if [ "$$choice" != "n" ] && [ "$$choice" != "N" ]; then \
echo "Installing..."; \
go install github.com/air-verse/air@latest; \
AIR_CMD="$(HOME)/go/bin/air"; \
else \
echo "Exiting..."; \
exit 1; \
fi; \
fi; \
if [ -z "$$NOTION_SECRET" ]; then \
echo "Setting NOTION_SECRET..."; \
export NOTION_SECRET=$$(op --account consoledotdev.1password.com \
read "op://Home/Notion API Key/credential"); \
fi; \
export DEBUG=true; \
echo "Starting Air..."; \
$$AIR_CMD
build:
@echo "Installing Tailwind..."
npm ci
@echo "Generate Tailwind CSS..."
go generate
@echo "Building Go server..."
go build -o tmp/server main.go
@echo "Build complete."