Files
vcpkg-tool/vcpkg-init/update-scripts-sha.ps1
Billy O'NealandCopilot 98d7cb0cf1 Update scripts SHA 2026-07-27 and add explicit override feature. (#2086)
The main purpose of this update is to do another tool release with the
"`liblas` passes meaningless bits to `vcpkg_download_distfile` problem
fixed. See:

*
https://github.com/microsoft/vcpkg/commit/fedb33341b54f50bc5fec18885dcb51311384eed
*
https://github.com/microsoft/vcpkg/commit/57884a6cb04a8e4720bf04d8ec5e5ab6092fe5d2

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-27 14:22:01 -07:00

27 lines
995 B
PowerShell

param(
[ValidatePattern('^[0-9a-fA-F]{40}$')]
[string]$Sha
)
if ($Sha) {
$Sha = $Sha.ToLowerInvariant()
} else {
$Sha = git ls-remote https://github.com/microsoft/vcpkg master |
ForEach-Object { [regex]::Match($_, '^[0-9a-f]+').Value } |
Select-Object -First 1
}
if (-not $Sha) { throw "Failed to determine vcpkg scripts SHA." }
"$Sha`n" | Out-File -LiteralPath "$PSScriptRoot/vcpkg-scripts-sha.txt" -Encoding Ascii -NoNewline
$configPath = (Resolve-Path -LiteralPath (Join-Path $PSScriptRoot '../src/vcpkg-configuration.json')).Path
$config = Get-Content -LiteralPath $configPath -Raw -Encoding Ascii | ConvertFrom-Json
if (-not $config.'default-registry') { throw "Missing default-registry in vcpkg-configuration.json." }
$config.'default-registry'.baseline = $Sha
$configJson = $config | ConvertTo-Json -Depth 100
$configJson = $configJson -replace "`r`n", "`n"
[System.IO.File]::WriteAllText($configPath, "$configJson`n", [System.Text.Encoding]::ASCII)