From f8cbd454a2b6c90264dd553dbd193a4d54c005fb Mon Sep 17 00:00:00 2001 From: wyc <1104749580@qq.com> Date: Mon, 6 Jul 2026 14:09:18 +0800 Subject: [PATCH] remove build_infra submodule --- .gitmodules | 3 --- init.bash | 30 ++++++++++++++++++++++++++++++ init.ps1 | 0 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 init.bash create mode 100644 init.ps1 diff --git a/.gitmodules b/.gitmodules index af4893c..6fa2040 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "third_party/build_infra"] - path = third_party/build_infra - url = http://192.168.1.75:3000/psc/build_infra.git [submodule "third_party/CPP_Core"] path = third_party/CPP_Core url = http://192.168.1.75:3000/psc/CPP_Core.git diff --git a/init.bash b/init.bash new file mode 100644 index 0000000..c1149eb --- /dev/null +++ b/init.bash @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -euo pipefail + +root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +cd "$root" +fetch_repo() { + local repo="$1" + local branch="$2" + local dir="$3" + if [ -d "$dir" ]; then + git -C "$dir" rev-parse --is-inside-work-tree >/dev/null + git -C "$dir" remote set-url origin "$repo" + git -C "$dir" fetch origin "$branch" + git -C "$dir" checkout "$branch" + git -C "$dir" pull --ff-only origin "$branch" + else + git clone --branch "$branch" --single-branch "$repo" "$dir" + fi +} + +fetch_repo_ex() { + local name="$1" + repo="http://192.168.1.75:3000/psc/${name}" + branch="master" + fetch_repo "${repo}" "$branch" "third_party/${name}" +} + +fetch_repo_ex "build_infra" +fetch_repo_ex "CPP_Core" +fetch_repo_ex "SSR" diff --git a/init.ps1 b/init.ps1 new file mode 100644 index 0000000..e69de29