( ctx context.Context, ce *clienv.CliEnv, curVersion string, )
| 25 | } |
| 26 | |
| 27 | func checkCLIVersion( |
| 28 | ctx context.Context, |
| 29 | ce *clienv.CliEnv, |
| 30 | curVersion string, |
| 31 | ) error { |
| 32 | mgr := software.NewManager() |
| 33 | |
| 34 | releases, err := mgr.GetReleases(ctx, curVersion) |
| 35 | if err != nil { |
| 36 | return fmt.Errorf("failed to get releases: %w", err) |
| 37 | } |
| 38 | |
| 39 | if len(releases) == 0 { |
| 40 | ce.Infoln( |
| 41 | "✅ Nhost CLI %s for %s-%s is already on the latest version", |
| 42 | curVersion, runtime.GOOS, runtime.GOARCH, |
| 43 | ) |
| 44 | |
| 45 | return nil |
| 46 | } |
| 47 | |
| 48 | latest := releases[0] |
| 49 | if latest.TagName == curVersion { |
| 50 | return nil |
| 51 | } |
| 52 | |
| 53 | ce.Warnln("🟡 A new version of Nhost CLI is available: %s", latest.TagName) |
| 54 | ce.Println(" You can upgrade the CLI by running `nhost sw upgrade`") |
| 55 | ce.Println(" More info: https://github.com/nhost/nhost/cli/releases") |
| 56 | |
| 57 | return nil |
| 58 | } |
| 59 | |
| 60 | func checkServiceVersion( |
| 61 | ce *clienv.CliEnv, |
no test coverage detected