From f1c27030d77478450a41396d0bd78716ac123c74 Mon Sep 17 00:00:00 2001 From: jingrow Date: Mon, 3 Nov 2025 21:33:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96dev=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dev.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dev.sh b/dev.sh index 0bf8805..63c122d 100755 --- a/dev.sh +++ b/dev.sh @@ -40,6 +40,11 @@ install_uv() { # 尝试把本次会话的 PATH 补上 export PATH="$HOME/.local/bin:$PATH" + # 如果 uv 安装脚本生成了会话环境文件,则立刻激活 + if [ -f "$HOME/.local/bin/env" ]; then + # shellcheck disable=SC1090 + source "$HOME/.local/bin/env" + fi if command -v uv &> /dev/null; then success "uv 安装完成" @@ -79,6 +84,11 @@ ensure_uv() { error "自动安装 uv 失败,请手动安装: curl -fsSL https://astral.sh/uv/install.sh | sh" exit 1 } + # 再次兜底激活环境,确保当前会话可用 + if [ -f "$HOME/.local/bin/env" ]; then + # shellcheck disable=SC1090 + source "$HOME/.local/bin/env" + fi } # 检查Redis