Update GaCy-GO
This commit is contained in:
1 parent
da8a32f60d
commit
0cbe460e49
345 files changed
+98202
-77559
No files matched your search
@@ -4,6 +4,10 @@ function Get-GoVersion([string]$Executable) {
|
||||
if ($LASTEXITCODE -ne 0 -or "$output" -notmatch '\bgo(\d+\.\d+(?:\.\d+)?)\b') { return $null }
|
||||
return [version]$Matches[1]
|
||||
}
|
||||
function Confirm-GoToolchainInstall([version]$Minimum) {
|
||||
$answer = Read-Host "Go >= $Minimum is required to build. Download and install it now? [y/N]"
|
||||
return $answer -match '^(?i:y|yes)$'
|
||||
}
|
||||
function Resolve-GoToolchain($Config) {
|
||||
$directive = Select-String -LiteralPath (Resolve-ProjectPath 'go.mod') -Pattern '^go\s+(\d+\.\d+(?:\.\d+)?)\s*$' | Select-Object -First 1
|
||||
if (-not $directive) { throw 'go.mod has no valid minimum Go version.' }
|
||||
@@ -30,6 +34,7 @@ function Resolve-GoToolchain($Config) {
|
||||
if ($version -and $version -ge $minimum) { return $cached }
|
||||
}
|
||||
}
|
||||
if (-not (Confirm-GoToolchainInstall $minimum)) { throw 'Go installation was declined. Install a compatible Go version, then run the build again.' }
|
||||
$machineArch = $env:PROCESSOR_ARCHITEW6432
|
||||
if (-not $machineArch) { $machineArch = $env:PROCESSOR_ARCHITECTURE }
|
||||
$arch = switch ($machineArch.ToUpperInvariant()) { 'AMD64' {'amd64'} 'ARM64' {'arm64'} 'X86' {'386'} default {throw "Unsupported Windows architecture: $machineArch"} }
|
||||
|
||||
Reference in new issue
Block a user