20 lines
536 B
Go
20 lines
536 B
Go
package loader
|
|
|
|
import (
|
|
"galaxy/connector"
|
|
"galaxy/util"
|
|
)
|
|
|
|
func (l *loader) newerVersion(version string) bool {
|
|
return util.CompareSemver(util.MustParseSemver(l.client.Version()), util.MustParseSemver(version)) > 0
|
|
}
|
|
|
|
// downloadVersion fetches given version artifact, when newer to the current version,
|
|
// and stores at the App's local storage with a pre-defined name with semver suffix
|
|
func (l *loader) downloadVersion(v connector.VersionInfo) {
|
|
if !l.newerVersion(v.Version) {
|
|
return
|
|
}
|
|
l.connector.DownloadVersion(v.URL)
|
|
}
|