From b539e3a42f991415dda37e929726d4f5fbe34fd2 Mon Sep 17 00:00:00 2001 From: zhaoxing <2558691827@qq.com> Date: Fri, 20 Nov 2026 14:48:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(dev):=20=E4=BF=AE=E5=A4=8D=20Windows=20?= =?UTF-8?q?=E4=B8=8B=E5=90=8E=E5=8F=B0=E8=B7=AF=E5=BE=84=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/dev.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/dev.sh b/scripts/dev.sh index dd8fe705..b7835bc1 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -40,6 +40,10 @@ GOOSE_BIN="${GOOSE_BIN:-}" GOPROXY="${DEV_GOPROXY:-${GOPROXY:-https://goproxy.cn,direct}}" export GOPROXY +# Git Bash 会把以 / 开头的环境变量值误当成 Windows 路径(如 /admin), +# 导致后台路由变成 C:/Program Files/Git/admin;这里仅排除该变量。 +export MSYS2_ENV_CONV_EXCL="${MSYS2_ENV_CONV_EXCL:+${MSYS2_ENV_CONV_EXCL};}VITE_ADMIN_BASE_PATH" + BACKEND_PID="" FRONTEND_PID="" DISTRIBUTION_PID="" @@ -510,6 +514,7 @@ load_env_file() { local line while IFS= read -r line || [[ -n "${line}" ]]; do + line="${line%$'\r'}" [[ -z "${line}" || "${line}" =~ ^[[:space:]]*# ]] && continue line="${line#export }" export "${line}"