Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var VersionCmd = &cobra.Command{ Use: "version", Short: "Get the Arcane server version", SilenceUsage: true, RunE: func(cmd *cobra.Command, args []string) error { logger.GetLogger().Debug("Fetching server version") c, err := client.NewFromConfig() if err != nil { return err } logger.GetLogger().Debug("Sending request", "endpoint", clitypes.AppVersionEndpoint) result, err := c.DoJSON[version.Info](cmd.Context(), http.MethodGet, clitypes.AppVersionEndpoint, nil) if err != nil { return errors.WrapIf(err, "failed to get version") } logger.GetLogger().Debug("Parsed version data", "result", result) if cmdutil.JSONOutputEnabled(cmd) { return cmdutil.PrintJSON(result) } output.Header("Arcane Environment Details: \n") output.KeyValue("Version", result.DisplayVersion) if result.Revision != "" { output.KeyValue("Revision", result.Revision) } if result.UpdateAvailable { output.Warning("Update available! New version: %s", result.NewestVersion) if result.ReleaseURL != "" { output.Info("Download at: %s", result.ReleaseURL) } } return nil }, }
VersionCmd gets the server version
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.