This commit is contained in:
tavo 2025-07-01 10:19:34 -06:00
parent 5d4c925130
commit c57bafa27d

View file

@ -3,7 +3,6 @@ SRC = $(wildcard *.go)
GO = $(shell which go) GO = $(shell which go)
DOTENV = .env DOTENV = .env
-include $(DOTENV)
TEMPLATE_SRC = $(shell find templates -type f) TEMPLATE_SRC = $(shell find templates -type f)
STATIC_SRC = $(shell find static -type f) STATIC_SRC = $(shell find static -type f)
@ -27,13 +26,15 @@ $(STATIC_DST): $(STATIC_SRC) scripts/minify.go
@$(GO) run scripts/minify.go -src=static -dst=$(STATIC_DST) @$(GO) run scripts/minify.go -src=static -dst=$(STATIC_DST)
@touch $@ @touch $@
run: $(BIN) run: $(BIN) $(DOTENV) datadir
@PRODUCTION=${PRODUCTION} \ @env $(shell cat $(DOTENV) | xargs) ./$(BIN)
PORT=${PORT} \
APP_DATA_DIR=${APP_DATA_DIR} \ $(DOTENV):
DB_CONNDVR=${DB_CONNDVR} \ @cp .env.example $@
DB_CONNSTR=${DB_CONNSTR} \
./$(BIN) datadir: $(DOTENV)
@APP_DATA_DIR=$$(grep '^APP_DATA_DIR=' $(DOTENV) | cut -d '=' -f2); \
if [ -n "$$APP_DATA_DIR" ]; then mkdir -p "$$APP_DATA_DIR"; fi
clean: clean:
@echo "🧹 Cleaning..." @echo "🧹 Cleaning..."