Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Commit d93769c

Browse files
committed
Don't re-download build and tools directory every time (#314)
1 parent d298565 commit d93769c

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

build/init.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ Function Get-BuildTools {
3030
if (-not (Test-Path $DirectoryPath)) {
3131
New-Item -Path $DirectoryPath -ItemType "directory"
3232
}
33+
34+
$MarkerFile = Join-Path $DirectoryPath ".marker"
35+
if (Test-Path $MarkerFile) {
36+
$content = Get-Content $MarkerFile
37+
if ($content -eq $Branch) {
38+
Write-Host "Build tools directory '$Path' is already at '$Branch'."
39+
return;
40+
}
41+
}
3342

3443
$FolderUri = "$RootGitHubApiUri/$Path$Ref"
3544
Write-Host "Downloading files from $FolderUri"
@@ -44,6 +53,8 @@ Function Get-BuildTools {
4453
Get-Folder -Path $FilePath
4554
}
4655
}
56+
57+
$Branch | Out-File $MarkerFile
4758
}
4859

4960
$FoldersToDownload = "build", "tools"

0 commit comments

Comments
 (0)