lyrics

lyrics
git clone git://brookjeynes.dev/bjeynes/lyrics.git
Log | Files | Refs

commit fd31086e8987fc126a0c6ef633266dff89fd300b
parent 5a0dab710ca30af1094bd3d437ca83553b4dee8a
Author: brookjeynes <me@brookjeynes.dev>
Date:   Sun,  7 Jun 2026 16:05:38 +1000

build: add makefile

Signed-off-by: brookjeynes <me@brookjeynes.dev>

Diffstat:
AMakefile | 35+++++++++++++++++++++++++++++++++++
Ddev.sh | 14--------------
Aminify.sh | 4++++
Dsetup.sh | 7-------
4 files changed, 39 insertions(+), 21 deletions(-)

diff --git a/Makefile b/Makefile @@ -0,0 +1,35 @@ +.PHONY: build run setup generate minify fmt security vet clean + +all: build + +build: fmt generate minify security vet + go build -o ./build/$(BINARY_NAME) $(CMD) + +run: fmt generate minify + set -a && source ./.env && set +a && go run cmd/server/main.go + +setup: + mkdir -p static/files/js + curl -sLo static/files/js/htmx.min.js https://cdn.jsdelivr.net/npm/htmx.org@4.0.0-beta2/dist/htmx.min.js + curl -sLo static/files/js/alpine.min.js https://cdn.jsdelivr.net/npm/alpinejs@3.15.11/dist/cdn.min.js + curl -sLo static/files/js/lucide.min.js https://unpkg.com/lucide@1.14.0/dist/umd/lucide.min.js + +generate: + go tool templ generate + +minify: + ./minify.sh + +fmt: + go fmt ./... + go tool templ fmt ./internal/server/ui/ + +security: + gosec ./... + +vet: + go vet ./... + +clean: + go clean + rm -rf ./build/* diff --git a/dev.sh b/dev.sh @@ -1,14 +0,0 @@ -#! /bin/bash - -go tool templ generate -go tool templ fmt ./internal/server/ui/ -go fmt ./... - -find internal static -path 'static/files' -prune -o -name '*.js' -print | while read f; do minify "$f" -o "static/files/js/$(basename "$f")"; done -find internal static -path 'static/files' -prune -o -name '*.css' -print | while read f; do minify "$f" -o "static/files/$(basename "$f")"; done - -if [ -f .env ]; then - export $(cat .env | sed 's/#.*//g' | xargs) -fi - -go run cmd/server/main.go diff --git a/minify.sh b/minify.sh @@ -0,0 +1,4 @@ +#! /bin/bash + +find internal static -path 'static/files' -prune -o -name '*.js' -print | while read f; do minify "$f" -o "static/files/js/$(basename "$f")"; done +find internal static -path 'static/files' -prune -o -name '*.css' -print | while read f; do minify "$f" -o "static/files/$(basename "$f")"; done diff --git a/setup.sh b/setup.sh @@ -1,7 +0,0 @@ -#! /bin/bash - -mkdir -p static/files/js - -curl -sLo static/files/js/htmx.min.js https://cdn.jsdelivr.net/npm/htmx.org@4.0.0-beta2/dist/htmx.min.js -curl -sLo static/files/js/alpine.min.js https://cdn.jsdelivr.net/npm/alpinejs@3.15.11/dist/cdn.min.js -curl -sLo static/files/js/lucide.min.js https://unpkg.com/lucide@1.14.0/dist/umd/lucide.min.js