MCPcopy Create free account
hub / github.com/anchordotdev/cli / ReleaseCheck

Function ReleaseCheck

version/version.go:13–38  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

11)
12
13func ReleaseCheck(cmd *cobra.Command, args []string) error {
14 if cli.SkipReleaseCheck || cli.IsDevVersion() {
15 return nil
16 }
17
18 ctx := cmd.Context()
19
20 isFresh, err := cli.IsFreshLatestRelease(ctx)
21 if err != nil {
22 return err
23 }
24 if isFresh {
25 return nil
26 }
27
28 isUpgradeable, err := cli.IsUpgradeable(ctx)
29 if err != nil {
30 return err
31 }
32
33 if isUpgradeable {
34 fmt.Println(ui.Header("New CLI Release Available"))
35 fmt.Println(ui.StepAlert("Run `anchor version upgrade` to upgrade."))
36 }
37 return nil
38}
39
40func isWindowsRuntime(cfg *cli.Config) bool {
41 return cfg.GOOS() == "windows"

Callers

nothing calls this directly

Calls 3

IsDevVersionFunction · 0.92
IsFreshLatestReleaseFunction · 0.92
IsUpgradeableFunction · 0.92

Tested by

no test coverage detected