From d93769ccd010801733f1e466d686142e7aff33de Mon Sep 17 00:00:00 2001 From: Joel Verhagen Date: Fri, 27 Sep 2019 09:26:58 -0700 Subject: [PATCH] Don't re-download build and tools directory every time (#314) --- build/init.ps1 | 11 +++++++++++ 1 file changed, 11 insertions(+) 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"