b 4 mesi fa
parent
commit
feec55bf26
4 ha cambiato i file con 82 aggiunte e 59 eliminazioni
  1. 36 0
      exapmle/init-backend.sh
  2. 11 0
      exapmle/init-frontend.sh
  3. 35 0
      exapmle/init.sh
  4. 0 59
      init.example

+ 36 - 0
exapmle/init-backend.sh

@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# 克隆 go-kit 仓库(如果不存在)
+echo ""
+if [ ! -d "/workspace/dev/backend/work/go-kit" ]; then
+	echo "正在克隆 go-kit 仓库..."
+	if git clone root@git.ooo.ink:root/go-kit.git /workspace/dev/backend/work/go-kit; then
+		echo "✅ go-kit 仓库克隆完成"
+	else
+		echo "❌ go-kit 仓库克隆失败"
+		exit 1
+	fi
+else
+	echo "✅ go-kit 仓库已存在,跳过克隆"
+fi
+echo ""
+
+# 安装 MySQL CLI 工具
+echo ""
+if [ -f "/workspace/shell-kit/setup-mysql-cli.sh" ]; then
+	chmod +x /workspace/shell-kit/setup-mysql-cli.sh
+	/workspace/shell-kit/setup-mysql-cli.sh
+else
+	echo "⚠️ 警告:MySQL CLI 安装脚本不存在,跳过 MySQL CLI 安装"
+fi
+echo ""
+
+# 安装 gentool 工具
+echo ""
+if [ -f "/workspace/shell-kit/setup-gentool.sh" ]; then
+	chmod +x /workspace/shell-kit/setup-gentool.sh
+	/workspace/shell-kit/setup-gentool.sh
+else
+	echo "⚠️ 警告:gentool 安装脚本不存在,跳过 gentool 安装"
+fi
+echo ""

+ 11 - 0
exapmle/init-frontend.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+echo ""
+# 安装 pnpm 包管理器
+if [ -f "/workspace/shell-kit/setup-pnpm.sh" ]; then
+	chmod +x /workspace/shell-kit/setup-pnpm.sh
+	/workspace/shell-kit/setup-pnpm.sh
+else
+	echo "⚠️ 警告:pnpm 安装脚本不存在,跳过 pnpm 安装"
+fi
+echo ""

+ 35 - 0
exapmle/init.sh

@@ -0,0 +1,35 @@
+#!/bin/bash
+
+# 先克隆 shell-kit 仓库(如果不存在)
+echo ""
+if [ ! -d "/workspace/shell-kit" ]; then
+	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
+echo ""
+
+# 配置 SSH 服务
+echo ""
+if [ -f "/workspace/shell-kit/setup-ssh.sh" ]; then
+	chmod +x /workspace/shell-kit/setup-ssh.sh
+	/workspace/shell-kit/setup-ssh.sh
+else
+	echo "⚠️ 警告:SSH 配置脚本不存在,跳过 SSH 配置"
+fi
+echo ""
+
+# 安装 trunk 工具并初始化
+echo ""
+if [ -f "/workspace/shell-kit/setup-trunk.sh" ]; then
+	chmod +x /workspace/shell-kit/setup-trunk.sh
+	/workspace/shell-kit/setup-trunk.sh
+else
+	echo "⚠️ 警告:trunk 安装脚本不存在,跳过 trunk 安装和初始化"
+fi
+echo ""

+ 0 - 59
init.example

@@ -1,59 +0,0 @@
-#!/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