MCPcopy Create free account
hub / github.com/Scalingo/cli / Check

Function Check

update/check.go:43–67  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

41}
42
43func Check(ctx context.Context) error {
44 version := config.Version
45
46 if strings.HasSuffix(version, "dev") {
47 fmt.Println("\nNo update checking, dev version:", version)
48 return nil
49 }
50
51 select {
52 case <-cancelUpdate:
53 return nil
54 case <-gotLastVersion:
55 }
56
57 if gotAnError {
58 return errors.New(ctx, "Update checker: connection error")
59 }
60 if version == lastVersion {
61 return nil
62 }
63
64 io.Errorf(io.BoldRed("Your Scalingo client (%s) is out-of-date: some features may not work correctly.\n"), version)
65 io.Errorf(io.BoldRed("Please update to '%s' by reinstalling it: https://cli.scalingo.com\n"), lastVersion)
66 return nil
67}
68
69func getLastVersion(ctx context.Context) (string, error) {
70 client := http.Client{

Callers 2

mainFunction · 0.92
update.goFile · 0.92

Calls 2

ErrorfFunction · 0.92
BoldRedFunction · 0.92

Tested by

no test coverage detected