Skip to content

Commit a4f56d5

Browse files
committed
Release v1.0.8
1 parent bcc09ed commit a4f56d5

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

main.go

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var (
2020
image string = "factory.talos.dev/metal-installer/956b9107edd250304169d2e7a765cdd4e0c31f9097036e2e113b042e6c01bb98:v1.10.4"
2121
k8sVersion string = "1.33.2"
2222
configDir string = "config"
23-
version = "v1.0.7"
23+
version = "v1.0.8"
2424
)
2525

2626
const (
@@ -153,6 +153,28 @@ func checkRequiredTools() error {
153153
return nil
154154
}
155155

156+
func checkLatestVersion() {
157+
const url = "https://api.github.com/repos/vasyakrg/talostpl/releases/latest"
158+
resp, err := http.Get(url)
159+
if err != nil {
160+
fmt.Printf("%s⚠️Warning: failed to check latest version%s\n", colorYellow, colorReset)
161+
return
162+
}
163+
defer resp.Body.Close()
164+
var data struct {
165+
TagName string `json:"tag_name"`
166+
}
167+
if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
168+
fmt.Printf("%s⚠️Warning: failed to check latest version%s\n", colorYellow, colorReset)
169+
return
170+
}
171+
if data.TagName != version {
172+
fmt.Printf("%s⚠️ Warning: your version is %s, latest is %s. Please update!%s\n", colorYellow, version, data.TagName, colorReset)
173+
} else {
174+
fmt.Printf("%s✅ You have the latest version %s%s\n", colorGreen, version, colorReset)
175+
}
176+
}
177+
156178
func askNumbered(prompt, def string) string {
157179
for {
158180
fmt.Print(prompt)
@@ -651,28 +673,6 @@ func printManualInitHelp(input FileInput, ans Answers) {
651673
fmt.Println("-----------------------------\n")
652674
}
653675

654-
func checkLatestVersion() {
655-
const url = "https://api.github.com/repos/vasyakrg/talostpl/releases/latest"
656-
resp, err := http.Get(url)
657-
if err != nil {
658-
fmt.Printf("%sWarning: failed to check latest version%s\n", colorYellow, colorReset)
659-
return
660-
}
661-
defer resp.Body.Close()
662-
var data struct {
663-
TagName string `json:"tag_name"`
664-
}
665-
if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
666-
fmt.Printf("%sWarning: failed to check latest version%s\n", colorYellow, colorReset)
667-
return
668-
}
669-
if data.TagName != version {
670-
fmt.Printf("%sWarning: your version is %s, latest is %s. Please update!%s\n", colorYellow, version, data.TagName, colorReset)
671-
} else {
672-
fmt.Printf("%sYou have the latest version %s%s\n\n", colorGreen, version, colorReset)
673-
}
674-
}
675-
676676
func generateCmd() *cobra.Command {
677677
var force bool
678678
var fromFile string

0 commit comments

Comments
 (0)