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)
|
||||
|
||||
DOTENV = .env
|
||||
-include $(DOTENV)
|
||||
|
||||
TEMPLATE_SRC = $(shell find templates -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)
|
||||
@touch $@
|
||||
|
||||
run: $(BIN)
|
||||
@PRODUCTION=${PRODUCTION} \
|
||||
PORT=${PORT} \
|
||||
APP_DATA_DIR=${APP_DATA_DIR} \
|
||||
DB_CONNDVR=${DB_CONNDVR} \
|
||||
DB_CONNSTR=${DB_CONNSTR} \
|
||||
./$(BIN)
|
||||
run: $(BIN) $(DOTENV) datadir
|
||||
@env $(shell cat $(DOTENV) | xargs) ./$(BIN)
|
||||
|
||||
$(DOTENV):
|
||||
@cp .env.example $@
|
||||
|
||||
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:
|
||||
@echo "🧹 Cleaning..."
|
||||
|
|
Loading…
Reference in a new issue