mirror of
https://github.com/aphrody-labs/vcpkg-tool.git
synced 2026-10-13 21:09:43 +00:00
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>
27 lines
995 B
PowerShell
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)
|