(currentVersion string)
| 103 | } |
| 104 | |
| 105 | func 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 | |
| 123 | func StartVersionChecker(currentVersion string) { |
| 124 |
no test coverage detected