Something went wrong. Try again.
Something went wrong. Try again.
atproto-playground Makefile
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879# Simple Makefile for a Go project
# Build the applicationall: build testtempl-install: @if ! command -v templ > /dev/null; then \ read -p "Go's 'templ' is not installed on your machine. Do you want to install it? [Y/n] " choice; \ if [ "$$choice" != "n" ] && [ "$$choice" != "N" ]; then \ go install github.com/a-h/templ/cmd/templ@latest; \ if [ ! -x "$$(command -v templ)" ]; then \ echo "templ installation failed. Exiting..."; \ exit 1; \ fi; \ else \ echo "You chose not to install templ. Exiting..."; \ exit 1; \ fi; \ fitailwind: @if [ ! -f tailwindcss ]; then curl -sL https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-macos-x64 -o tailwindcss; fi @chmod +x tailwindcss
build: tailwind templ-install @echo "Building..." @templ generate @./tailwindcss -i cmd/web/assets/css/input.css -o cmd/web/assets/css/output.css @go build -o main cmd/api/main.go
# Run the applicationrun: @go run cmd/api/main.go# Create DB containerdocker-run: @if docker compose up --build 2>/dev/null; then \ : ; \ else \ echo "Falling back to Docker Compose V1"; \ docker-compose up --build; \ fi
# Shutdown DB containerdocker-down: @if docker compose down 2>/dev/null; then \ : ; \ else \ echo "Falling back to Docker Compose V1"; \ docker-compose down; \ fi
# Test the applicationtest: @echo "Testing..." @go test ./... -v
# Clean the binaryclean: @echo "Cleaning..." @rm -f main
# Live Reloadwatch: @if command -v air > /dev/null; then \ air; \ echo "Watching...";\ else \ read -p "Go's 'air' is not installed on your machine. Do you want to install it? [Y/n] " choice; \ if [ "$$choice" != "n" ] && [ "$$choice" != "N" ]; then \ go install github.com/air-verse/air@latest; \ air; \ echo "Watching...";\ else \ echo "You chose not to install air. Exiting..."; \ exit 1; \ fi; \ fi
.PHONY: all build run test clean watch tailwind templ-install