chore(makefile): optimize build script auto-compile when static files are missing

This commit is contained in:
fanlv 2025-07-23 14:42:12 +08:00
parent dc984f8afb
commit 59729f01b2
1 changed files with 5 additions and 0 deletions

View File

@ -12,6 +12,7 @@ COMPOSE_FILE := docker/docker-compose.yml
MYSQL_SCHEMA := ./docker/volumes/mysql/schema.sql MYSQL_SCHEMA := ./docker/volumes/mysql/schema.sql
MYSQL_INIT_SQL := ./docker/volumes/mysql/sql_init.sql MYSQL_INIT_SQL := ./docker/volumes/mysql/sql_init.sql
ENV_FILE := ./docker/.env ENV_FILE := ./docker/.env
STATIC_DIR := ./bin/resources/static
debug: middleware python server debug: middleware python server
@ -20,6 +21,10 @@ fe:
@bash $(BUILD_FE_SCRIPT) @bash $(BUILD_FE_SCRIPT)
server: server:
@if [ ! -d "$(STATIC_DIR)" ]; then \
echo "Static directory '$(STATIC_DIR)' not found, building frontend..."; \
$(MAKE) fe; \
fi
@echo "Building and run server..." @echo "Building and run server..."
@bash $(BUILD_SERVER_SCRIPT) -start @bash $(BUILD_SERVER_SCRIPT) -start