#8 change update mod.
This commit is contained in:
@@ -163,6 +163,7 @@ func Query(modpath string, cached bool) (*Module, bool, error) {
|
||||
// cached sets the Disable-Module-Fetch: true header
|
||||
func Latest(modpath string, cached bool) (*Module, error) {
|
||||
latest, ok, err := Query(modpath, cached)
|
||||
fmt.Println("latest: ", latest)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -275,7 +276,14 @@ func Updates(opt UpdateOptions) {
|
||||
ch <- Update{Module: m, Err: err}
|
||||
return nil
|
||||
}
|
||||
v := mod.MaxVersion("", opt.Pre)
|
||||
prefix, ok := ModMajor(mod.Path)
|
||||
var v string
|
||||
switch ok {
|
||||
case true:
|
||||
v = mod.MaxVersion(prefix, opt.Pre)
|
||||
default:
|
||||
v = mod.MaxVersion("", opt.Pre)
|
||||
}
|
||||
if IsNewerVersion(m.Version, v, opt.Major) {
|
||||
ch <- Update{Module: m, Version: v}
|
||||
}
|
||||
|
Reference in New Issue
Block a user