Skip to content

Commit a7dbc95

Browse files
author
EwanNoble
committed
Massively speed up Github as dependency source
1 parent 8333d92 commit a7dbc95

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Build-Task.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,19 @@ try {
206206
$RepositoryUrl = "https://github.com/$($Package.Name).git"
207207
$RepositoryDestination = "$PackageTemp/$($Package.Name.Split("/")[1])"
208208
Write-Host "[GitHub] Processing $($RepositoryUrl)"
209-
& git.exe clone $RepositoryUrl $RepositoryDestination | Out-Null
209+
& git.exe clone `
210+
--depth 1 `
211+
--no-checkout `
212+
$RepositoryUrl `
213+
$RepositoryDestination
210214

211215
if ($Package.Copy) {
212216
$Package.Copy | ForEach-Object {
217+
& git.exe -C $RepositoryDestination checkout HEAD "$_/*"
213218
Write-Host "[GitHub] Copying dependency $_ to $($Package.Path)"
214219
Copy-Item -Path $RepositoryDestination/$_ -Destination $ResolvedPackagePath -Recurse -Force
215220
}
216221
}
217-
218222
break
219223
}
220224
'Local' {

0 commit comments

Comments
 (0)