mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 09:18:34 +00:00
Update proto file and fix protoc version parsing
The new protoc cli return version v23.1, so we parse the file version v4.23.1 without "4."
This commit is contained in:
parent
c9f517108c
commit
d11d72be6c
73 changed files with 238 additions and 205 deletions
|
@ -108,7 +108,7 @@ func getProjectProtocVersion(url string) (string, error) {
|
|||
if err != nil {
|
||||
return "", fmt.Errorf("can not read from body")
|
||||
}
|
||||
versionRegexp := regexp.MustCompile(`\/\/\s*protoc\s*v(\d+\.\d+\.\d+)`)
|
||||
versionRegexp := regexp.MustCompile(`\/\/\s*protoc\s*v\d+\.(\d+\.\d+)`)
|
||||
matched := versionRegexp.FindStringSubmatch(string(body))
|
||||
return matched[1], nil
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ func getInstalledProtocVersion(protocPath string) (string, error) {
|
|||
if cmdErr != nil {
|
||||
return "", cmdErr
|
||||
}
|
||||
versionRegexp := regexp.MustCompile(`protoc\s*(\d+\.\d+\.\d+)`)
|
||||
versionRegexp := regexp.MustCompile(`protoc\s*(\d+\.\d+)`)
|
||||
matched := versionRegexp.FindStringSubmatch(string(output))
|
||||
return matched[1], nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue