IsVersionAtLeast returns whether the git version is the one specified or higher argument is plain version string separated by '.' e.g. "2.3.1" but can omit minor/patch
(ver string)
| 26 | // IsVersionAtLeast returns whether the git version is the one specified or higher |
| 27 | // argument is plain version string separated by '.' e.g. "2.3.1" but can omit minor/patch |
| 28 | func IsGitVersionAtLeast(ver string) bool { |
| 29 | gitver, err := Version() |
| 30 | if err != nil { |
| 31 | tracerx.Printf("Error getting git version: %v", err) |
| 32 | return false |
| 33 | } |
| 34 | return IsVersionAtLeast(gitver, ver) |
| 35 | } |
| 36 | |
| 37 | // IsVersionAtLeast compares 2 version strings (ok to be prefixed with 'git version', ignores) |
| 38 | func IsVersionAtLeast(actualVersion, desiredVersion string) bool { |