更新安装脚本
This commit is contained in:
Vendored
+25
-10
@@ -13,33 +13,48 @@ function Fetch-Repo
|
||||
{
|
||||
param(
|
||||
[string]$Repo,
|
||||
[string]$Branch,
|
||||
[string]$Dir
|
||||
[string]$Dir,
|
||||
[string]$Branch
|
||||
)
|
||||
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
|
||||
if ( [string]::IsNullOrWhiteSpace($Branch))
|
||||
{
|
||||
git -C $Dir fetch origin
|
||||
git -C $Dir remote set-head origin --auto
|
||||
$remoteHead = git -C $Dir symbolic-ref --short refs/remotes/origin/HEAD
|
||||
$Branch = $remoteHead -replace "^origin/", ""
|
||||
}
|
||||
else
|
||||
{
|
||||
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
|
||||
if ( [string]::IsNullOrWhiteSpace($Branch))
|
||||
{
|
||||
git clone --single-branch $Repo $Dir
|
||||
}
|
||||
else
|
||||
{
|
||||
git clone --branch $Branch --single-branch $Repo $Dir
|
||||
}
|
||||
}
|
||||
}
|
||||
function Fetch-RepoEx
|
||||
{
|
||||
param(
|
||||
[string]$Name
|
||||
[string]$Name,
|
||||
[string]$Branch
|
||||
)
|
||||
$repo = "$remoteRoot/$Name"
|
||||
$branch = "master"
|
||||
Fetch-Repo -Repo $repo -Branch $branch -Dir "third_party/$Name"
|
||||
Fetch-Repo -Repo $repo -Dir "third_party/$Name" -Branch $Branch
|
||||
}
|
||||
|
||||
|
||||
Fetch-RepoEx "build_infra"
|
||||
Fetch-RepoEx "CPP_Core"
|
||||
Fetch-RepoEx "Renderive"
|
||||
Fetch-RepoEx "Renderive" "restart"
|
||||
Reference in New Issue
Block a user