cli

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaybePrintUpdateNudge

func MaybePrintUpdateNudge(out io.Writer)

MaybePrintUpdateNudge writes a one-line "new release available" footer to `out` when the cache says a newer version exists. Safe no-op when the cache is empty or the running binary is already current.

func NewRootCmd

func NewRootCmd() *cobra.Command

func StartUpdateCheck

func StartUpdateCheck(ctx context.Context, subCommand string)

StartUpdateCheck primes the in-process cache from disk and, if the cached answer is stale (or absent), spawns a background goroutine that hits the GitHub Releases API. The goroutine writes to the cache file so a slow first run still benefits a fast second run. Call WaitForUpdateCheck before MaybePrintUpdateNudge in main, so a freshly fetched result has a chance to land before we decide whether to nudge.

Skips entirely when:

  • the running subcommand is `upgrade` (does its own check),
  • stderr isn't a TTY (piped output, CI),
  • NORCUBE_NO_UPDATE_CHECK is set,
  • the binary was built without -ldflags (Version == "dev").

func WaitForUpdateCheck

func WaitForUpdateCheck()

WaitForUpdateCheck blocks for up to updateCheckWaitBudget if a background check is in flight. No-op when StartUpdateCheck didn't launch one (cache was fresh, or the check was skipped).

Types

This section is empty.

Directories

Path Synopsis
Package backup implements the `norcube backup ...` command tree (snapdb is the backend service behind the Norcube Backup product).
Package backup implements the `norcube backup ...` command tree (snapdb is the backend service behind the Norcube Backup product).
Package langsync implements the `norcube langsync ...` command tree.
Package langsync implements the `norcube langsync ...` command tree.
projectcfg
Package projectcfg loads and writes the per-project Langsync config (`.langsync.json`).
Package projectcfg loads and writes the per-project Langsync config (`.langsync.json`).
projectcfg/translations
Package translations reads and writes language files for the sync command.
Package translations reads and writes language files for the sync command.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL