version

package
v2.10.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

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.

Jump to

Keyboard shortcuts

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