子模块
This commit is contained in:
Vendored
-1
Submodule third_party/CPP_Core deleted from d7843492bb
Vendored
-1
Submodule third_party/Graphic_Core deleted from 8c8cc8707b
Vendored
-1
Submodule third_party/build_infra deleted from 8440aac659
Vendored
+30
@@ -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 "Graphic_Core"
|
||||
Vendored
+40
@@ -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 "Graphic_Core"
|
||||
Reference in New Issue
Block a user