From 7f03e900684480fbabaa1ae5d94d0ec4658f0ab7 Mon Sep 17 00:00:00 2001 From: wyc <1104749580@qq.com> Date: Mon, 6 Jul 2026 14:11:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=AD=90=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=20=20=E6=94=B9=E7=94=A8=E8=87=AA=E5=AE=9A=E4=B9=89=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + .gitmodules | 6 ----- init.ps1 | 0 init.bash => third_party/init.bash | 0 third_party/init.ps1 | 40 ++++++++++++++++++++++++++++++ 5 files changed, 41 insertions(+), 6 deletions(-) delete mode 100644 .gitmodules delete mode 100644 init.ps1 rename init.bash => third_party/init.bash (100%) create mode 100644 third_party/init.ps1 diff --git a/.gitignore b/.gitignore index 82b4b62..906969a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /sqlite/ /data/ /.idea +/third_party diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 6fa2040..0000000 --- a/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "third_party/CPP_Core"] - path = third_party/CPP_Core - url = http://192.168.1.75:3000/psc/CPP_Core.git -[submodule "third_party/SSR"] - path = third_party/SSR - url = http://192.168.1.75:3000/psc/SSR.git diff --git a/init.ps1 b/init.ps1 deleted file mode 100644 index e69de29..0000000 diff --git a/init.bash b/third_party/init.bash similarity index 100% rename from init.bash rename to third_party/init.bash diff --git a/third_party/init.ps1 b/third_party/init.ps1 new file mode 100644 index 0000000..8fc8141 --- /dev/null +++ b/third_party/init.ps1 @@ -0,0 +1,40 @@ +$ErrorActionPreference = "Stop" +$scriptDir = $PSScriptRoot +if ( [string]::IsNullOrWhiteSpace($scriptDir)) +{ + $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path +} +$root = (Resolve-Path -LiteralPath (Join-Path $scriptDir "..")).Path +Set-Location -LiteralPath $root +function Fetch-Repo +{ + param( + [string]$Repo, + [string]$Branch, + [string]$Dir + ) + if (Test-Path -LiteralPath $Dir -PathType Container) + { + git -C $Dir rev-parse --is-inside-work-tree *> $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 + } +} +function Fetch-RepoEx +{ + param( + [string]$Name + ) + $repo = "http://192.168.1.75:3000/psc/$Name" + $branch = "master" + Fetch-Repo -Repo $repo -Branch $branch -Dir "third_party/$Name" +} +Fetch-RepoEx "build_infra" +Fetch-RepoEx "CPP_Core" +Fetch-RepoEx "SSR" \ No newline at end of file