Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "crate", Short: "Crate open source CLI", Version: Version, PersistentPreRun: func(cmd *cobra.Command, args []string) { if cmd.Name() == "update" || cmd.Name() == "install" || cmd.Name() == "run" { return } lastCheck := cli.GetLastCheck() if time.Since(lastCheck) > 24*time.Hour { release, err := updater.CheckForUpdate(Version) if err == nil && release != nil { fmt.Printf("\n✨ A new version of crate is available! (%s)\n👉 Run `crate update` to install it.\n\n", release.TagName) } _ = cli.UpdateLastCheck(time.Now()) } }, }
View Source
var (
Version = "dev"
)
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately.
func ResolveEndpoint ¶
func ResolveEndpoint() string
ResolveEndpoint returns the appropriate API endpoint based on flags
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.