From 0bfa7abfd080f2e3d0214577b9f6e799f2979c0d Mon Sep 17 00:00:00 2001 From: chengqian Date: Thu, 14 May 2026 10:22:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Dmakefile=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 8dc23c0..0d1de8b 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,14 @@ -ROOT_DIR = $(shell pwd) +ROOT_DIR = $(CURDIR) DEPLOY_NAME = "team-api" DOCKER_NAME = "team-api" -VERSION ?= $(shell cat VERSION 2>/dev/null | tr -d '[:space:]') +VERSION ?= $(strip $(file < VERSION)) LDFLAGS = -X github.com/qianfree/team-api/internal/consts.Version=$(VERSION) # Mirror acceleration (override for non-China regions) GOPROXY ?= https://goproxy.cn,direct BUN_REGISTRY ?= https://registry.npmmirror.com -export GOPROXY +BUN_CONFIG_REGISTRY = $(BUN_REGISTRY) +export GOPROXY BUN_CONFIG_REGISTRY # Cross-compile: make build GOOS=windows GOARCH=amd64 GOOS ?= $(shell go env GOOS) @@ -40,8 +41,8 @@ build: # Build frontend assets build-web: - cd web/admin && BUN_CONFIG_REGISTRY=$(BUN_REGISTRY) bun install && bun run build - cd web/tenant && BUN_CONFIG_REGISTRY=$(BUN_REGISTRY) bun install && bun run build + cd web/admin && bun install && bun run build + cd web/tenant && bun install && bun run build # Build all (frontend embedded into backend binary) build-all: build-web @@ -92,4 +93,4 @@ docker-rebuild: docker-down docker-clean: cd manifest/docker && docker compose down -v - docker volume rm team-api-postgres_data team-api-redis_data team-api-app_logs 2>/dev/null || true + -docker volume rm team-api-postgres_data team-api-redis_data team-api-app_logs