mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-26 13:23:05 +07:00
Fix protoc setup
This commit is contained in:
parent
d37cc30485
commit
9e33c7b24e
@ -1,6 +1,6 @@
|
|||||||
Function Get-ProtobufTag() {
|
Function Get-ProtobufTag() {
|
||||||
if("$protobuf_tag" -eq "latest") {
|
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 {
|
} else {
|
||||||
try {
|
try {
|
||||||
[net.httpWebRequest] $request = [net.webRequest]::create("https://github.com/protocolbuffers/protobuf/releases/tag/v$protobuf_tag")
|
[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()
|
$response.Close()
|
||||||
$protobuf_tag = "v$protobuf_tag"
|
$protobuf_tag = "v$protobuf_tag"
|
||||||
} catch {
|
} 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
|
return $protobuf_tag
|
||||||
|
Loading…
Reference in New Issue
Block a user