Skip to content

Commit

Permalink
changed rn paths
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Jul 16, 2021
1 parent f388bf5 commit 1754766
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,20 @@ func newVerNotification(vc chan string) {
select {
case ver, ok := <-vc:
if ok {
log.Infof("🎉 New containerlab version %s is available! Release notes: https://containerlab.srlinux.dev/rn/%s\nRun 'containerlab version upgrade' to upgrade or go check other installation options at https://containerlab.srlinux.dev/install/\n", ver, ver)
v, _ := gover.NewVersion(ver)
segments := v.Segments()
maj := segments[0]
min := segments[1]
patch := segments[2]

// relSlug is the URI path attribute of a given rel version
// for 0.15.0 version, the relSlug will be 0.15/
// for 0.15.1 - 0.15/#0.15.1
relSlug := fmt.Sprintf("%d.%d/", maj, min)
if patch != 0 {
relSlug = relSlug + fmt.Sprintf("#%d.%d.%d", maj, min, patch)
}
log.Infof("🎉 New containerlab version %s is available! Release notes: https://containerlab.srlinux.dev/rn/%s\nRun 'containerlab version upgrade' to upgrade or go check other installation options at https://containerlab.srlinux.dev/install/\n", v.String(), relSlug)
}
default:
return
Expand Down

0 comments on commit 1754766

Please sign in to comment.