diff --git a/external/Get-GitModules.ps1 b/external/Get-GitModules.ps1 index 7238700d..a2791616 100644 --- a/external/Get-GitModules.ps1 +++ b/external/Get-GitModules.ps1 @@ -14,8 +14,13 @@ [String] $PathRegex = "path\s*=\s*(?.*)" [String] $URLRegex = "url\s*=\s*(?.*)" [String] $BranchRegex = "branch\s*=\s*(?.*)" +[String] $Arguments = $($args -join " ") #------- Script ---------------------------------------------------------------- +if ([string]::IsNullOrEmpty($Arguments)) { + $Arguments = "--depth 1" +} + foreach ($Line in Get-Content $PSScriptRoot\..\.gitmodules) { if ($Line -match $PathRegex) { $Match = Select-String -InputObject $Line -Pattern $PathRegex @@ -29,8 +34,8 @@ foreach ($Line in Get-Content $PSScriptRoot\..\.gitmodules) { $Match = Select-String -InputObject $Line -Pattern $BranchRegex $Branch = $Match.Matches[0].Groups[1].Value - Write-Host "git clone --filter=blob:none $URL $Path -b $Branch --recursive" ` + Write-Host "git clone --filter=blob:none $URL $Path -b $Branch --recursive $Arguments" ` -ForegroundColor Blue - git clone --filter=blob:none $URL $PSScriptRoot/../$Path -b $Branch --recursive + git clone --filter=blob:none $URL $PSScriptRoot/../$Path -b $Branch --recursive $Arguments } } diff --git a/external/download.sh b/external/download.sh index b78a4a50..ebfc5fbe 100755 --- a/external/download.sh +++ b/external/download.sh @@ -14,5 +14,10 @@ while true; do url=$3 read line; set -- $line branch=$3 + + if [ -z "$ARGUMENTS" ]; then + ARGUMENTS="--depth 1" + fi + git clone --filter=blob:none $url $path -b $branch --recursive $ARGUMENTS done