chore(shell): auto cp .env form .env.example when debug

* chore(shell): auto cp .env form .env.example when debug
* chore(docker): using default env example if env not exit when debug app

See merge request: !910
This commit is contained in:
樊侣
2025-07-25 03:50:24 +00:00
parent 5343a7718d
commit f3934ccf62
8 changed files with 25 additions and 19 deletions

View File

@ -14,13 +14,19 @@ MYSQL_INIT_SQL := ./docker/volumes/mysql/sql_init.sql
ENV_FILE := ./docker/.env
STATIC_DIR := ./bin/resources/static
debug: middleware python server
debug: env middleware python server
env:
@if [ ! -f "$(ENV_FILE)" ]; then \
echo "Env file '$(ENV_FILE)' not found, using example env..."; \
cp ./docker/.env.example $(ENV_FILE); \
fi
fe:
@echo "Building frontend..."
@bash $(BUILD_FE_SCRIPT)
server:
server: env
@if [ ! -d "$(STATIC_DIR)" ]; then \
echo "Static directory '$(STATIC_DIR)' not found, building frontend..."; \
$(MAKE) fe; \
@ -83,6 +89,7 @@ help:
@echo ""
@echo "Targets:"
@echo " debug - Start the debug environment."
@echo " env - Setup env file."
@echo " fe - Build the frontend."
@echo " server - Build and run the server binary."
@echo " build_server - Build the server binary."