| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #!/bin/bash
- # 先克隆 shell-kit 仓库(如果不存在)
- if [ ! -d "/workspace/shell-kit" ]; then
- echo "正在克隆 shell-kit 仓库..."
- if git clone root@git.ooo.ink:root/shell-kit.git /workspace/shell-kit; then
- echo "shell-kit 仓库克隆完成"
- else
- echo "错误:shell-kit 仓库克隆失败"
- exit 1
- fi
- else
- echo "shell-kit 仓库已存在,跳过克隆"
- fi
- # 配置 SSH 服务
- if [ -f "/workspace/shell-kit/setup-ssh.sh" ]; then
- echo "正在配置 SSH 服务..."
- chmod +x /workspace/shell-kit/setup-ssh.sh
- /workspace/shell-kit/setup-ssh.sh
- else
- echo "警告:SSH 配置脚本不存在,跳过 SSH 配置"
- fi
- # 安装 trunk 工具并初始化
- if [ -f "/workspace/shell-kit/setup-trunk.sh" ]; then
- echo "正在安装 trunk 工具并初始化..."
- chmod +x /workspace/shell-kit/setup-trunk.sh
- /workspace/shell-kit/setup-trunk.sh
- else
- echo "警告:trunk 安装脚本不存在,跳过 trunk 安装和初始化"
- fi
- # 安装 gentool 工具
- if [ -f "/workspace/shell-kit/setup-gentool.sh" ]; then
- echo "正在安装 gentool 工具..."
- chmod +x /workspace/shell-kit/setup-gentool.sh
- /workspace/shell-kit/setup-gentool.sh
- else
- echo "警告:gentool 安装脚本不存在,跳过 gentool 安装"
- fi
- # 安装 MySQL CLI 工具
- if [ -f "/workspace/shell-kit/setup-mysql-cli.sh" ]; then
- echo "正在安装 MySQL CLI 工具..."
- chmod +x /workspace/shell-kit/setup-mysql-cli.sh
- /workspace/shell-kit/setup-mysql-cli.sh
- else
- echo "警告:MySQL CLI 安装脚本不存在,跳过 MySQL CLI 安装"
- fi
- # 安装 pnpm 包管理器
- if [ -f "/workspace/shell-kit/setup-pnpm.sh" ]; then
- echo "正在安装 pnpm 包管理器并清理缓存..."
- chmod +x /workspace/shell-kit/setup-pnpm.sh
- /workspace/shell-kit/setup-pnpm.sh
- else
- echo "警告:pnpm 安装脚本不存在,跳过 pnpm 安装和缓存清理"
- fi
|