优化dev启动脚本

This commit is contained in:
jingrow 2025-11-03 21:33:15 +08:00
parent f696e0d35d
commit f1c27030d7

10
dev.sh
View File

@ -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