diff --git a/build/init.ps1 b/build/init.ps1 index 3849eef1..ca9119cc 100644 --- a/build/init.ps1 +++ b/build/init.ps1 @@ -30,6 +30,15 @@ Function Get-BuildTools { if (-not (Test-Path $DirectoryPath)) { New-Item -Path $DirectoryPath -ItemType "directory" } + + $MarkerFile = Join-Path $DirectoryPath ".marker" + if (Test-Path $MarkerFile) { + $content = Get-Content $MarkerFile + if ($content -eq $Branch) { + Write-Host "Build tools directory '$Path' is already at '$Branch'." + return; + } + } $FolderUri = "$RootGitHubApiUri/$Path$Ref" Write-Host "Downloading files from $FolderUri" @@ -44,6 +53,8 @@ Function Get-BuildTools { Get-Folder -Path $FilePath } } + + $Branch | Out-File $MarkerFile } $FoldersToDownload = "build", "tools"