makefile
This commit is contained in:
parent
5d4c925130
commit
c57bafa27d
1 changed files with 9 additions and 8 deletions
|
@ -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..."
|
||||||
|
|
Loading…
Reference in a new issue