mirror of
https://github.com/TECHNOFAB11/powerproto.git
synced 2025-12-12 08:00:04 +01:00
fix(protoc): only use regular version
Signed-off-by: storyicon <yuanchao@bilibili.com>
This commit is contained in:
parent
8bdd192681
commit
ef9cf8a802
3 changed files with 66 additions and 3 deletions
|
|
@ -115,7 +115,17 @@ func GetExitCode(err error) int {
|
|||
return 1
|
||||
}
|
||||
|
||||
var regexpEnvironmentVar = regexp.MustCompile(`\$[A-Za-z_]+`)
|
||||
var (
|
||||
regexpEnvironmentVar = regexp.MustCompile(`\$[A-Za-z_]+`)
|
||||
regexpRegularVersion = regexp.MustCompile(`^v[0-9]+\.[0-9]+\.[0-9]+$`)
|
||||
)
|
||||
|
||||
|
||||
// IsRegularVersion is used to determine whether the version number is a regular version number
|
||||
// Regular: va.b.c, and a, b, c are all numbers
|
||||
func IsRegularVersion(s string) bool {
|
||||
return regexpRegularVersion.MatchString(s)
|
||||
}
|
||||
|
||||
// RenderWithEnv is used to render string with env
|
||||
func RenderWithEnv(s string, ext map[string]string) string {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue