MCPcopy Create free account
hub / github.com/MertJSX/folderhost / checkAndNotifyVersion

Function checkAndNotifyVersion

utils/version_checker.go:105–121  ·  view source on GitHub ↗
(currentVersion string)

Source from the content-addressed store, hash-verified

103}
104
105func checkAndNotifyVersion(currentVersion string) {
106 hasUpdate, newVersion := checkForUpdates(currentVersion)
107 if hasUpdate {
108 updateText := color.New(color.FgYellow).Add(color.Bold)
109 normalText := color.RGB(169, 169, 169)
110 greenText := color.New(color.FgGreen).Add(color.Bold)
111
112 updateText.Printf("\n New version available: ")
113 greenText.Printf("%s", newVersion)
114 normalText.Print(" (Current: ")
115 fmt.Printf("%s", currentVersion)
116 normalText.Print(")\n")
117 normalText.Print(" Download: ")
118 cyanText := color.New(color.FgCyan)
119 cyanText.Print("https://github.com/MertJSX/folderhost/releases\n\n")
120 }
121}
122
123func StartVersionChecker(currentVersion string) {
124

Callers 1

StartVersionCheckerFunction · 0.85

Calls 1

checkForUpdatesFunction · 0.85

Tested by

no test coverage detected