GODT-1977: fix launcher for v2 to v3 updates.

This commit is contained in:
Jakub
2022-11-03 14:01:26 +01:00
committed by James Houlahan
parent 34213d1607
commit c08d0eff7a
8 changed files with 79 additions and 17 deletions

View File

@ -72,6 +72,10 @@ func (v *Versioner) ListVersions() (Versions, error) {
// GetExecutableInDirectory returns the full path to the executable in the given directory, if present.
// It returns an error if the executable is missing or does not have executable permissions set.
func (v *Versioner) GetExecutableInDirectory(name, directory string) (string, error) {
return getExecutableInDirectory(name, directory)
}
func getExecutableInDirectory(name, directory string) (string, error) {
exe := filepath.Join(directory, getExeName(name))
if !fileExists(exe) || !fileIsExecutable(exe) {
@ -80,3 +84,10 @@ func (v *Versioner) GetExecutableInDirectory(name, directory string) (string, er
return exe, nil
}
func IsNewerIgnorePrerelease(a, b *semver.Version) bool {
aN, _ := a.SetPrerelease("")
bN, _ := b.SetPrerelease("")
return aN.GreaterThan(&bN)
}