mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Fix protoc setup
This commit is contained in:
parent
d37cc30485
commit
9e33c7b24e
@ -1,6 +1,6 @@
|
||||
Function Get-ProtobufTag() {
|
||||
if("$protobuf_tag" -eq "latest") {
|
||||
$protobuf_tag = (Invoke-RestMethod https://api.github.com/repos/protocolbuffers/protobuf/tags).Name | Where-Object { $_ -match "v\d+.\d+.\d+$" } | Select-Object -First 1
|
||||
$protobuf_tag = (Invoke-RestMethod https://api.github.com/repos/protocolbuffers/protobuf/releases).tag_name | Where-Object { $_ -match "v\d+.\d+.\d+$" } | Select-Object -First 1
|
||||
} else {
|
||||
try {
|
||||
[net.httpWebRequest] $request = [net.webRequest]::create("https://github.com/protocolbuffers/protobuf/releases/tag/v$protobuf_tag")
|
||||
@ -9,7 +9,7 @@ Function Get-ProtobufTag() {
|
||||
$response.Close()
|
||||
$protobuf_tag = "v$protobuf_tag"
|
||||
} catch {
|
||||
$protobuf_tag = (Invoke-RestMethod https://api.github.com/repos/protocolbuffers/protobuf/tags).Name | Where-Object { $_ -match "v\d+.\d+.\d+$" } | Select-Object -First 1
|
||||
$protobuf_tag = (Invoke-RestMethod https://api.github.com/repos/protocolbuffers/protobuf/releases).tag_name | Where-Object { $_ -match "v\d+.\d+.\d+$" } | Select-Object -First 1
|
||||
}
|
||||
}
|
||||
return $protobuf_tag
|
||||
|
Loading…
Reference in New Issue
Block a user