#!/bin/bash # 安装 Bun 的脚本 # 用于安装 Bun 工具 # https://bun.com source /root/.bashrc # 检查 bun 是否已安装 if command -v bun >/dev/null 2>&1; then echo "✅ bun 已安装" else echo "📥 开始安装 bun ..." # 安装 bun echo "📦 正在安装 bun ..." if ! curl -fsSL https://bun.sh/install | bash; then echo "❌ bun 安装失败" exit 1 fi # 验证 bun 安装是否成功 if command source /root/.bashrc && command -v bun >/dev/null 2>&1; then echo "✅ bun 安装成功" else echo "❌ bun 安装失败" exit 1 fi fi