template

package
v0.1.0-preview.7.rc Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cli.Command{
	Name:  "template",
	Usage: "Manage project templates",
	Subcommands: []*cli.Command{
		InfoCommand,
		UpgradeCommand,
	},
}

Command defines the main "template" command for template operations

View Source
var InfoCommand = &cli.Command{
	Name:  "info",
	Usage: "Display information about the current project template",
	Action: func(cCtx *cli.Context) error {

		logger := common.LoggerFromContext(cCtx)

		projectName, templateBaseURL, templateVersion, templateLanguage, err := GetTemplateInfo()
		if err != nil {
			return err
		}

		logger.Info("Project template information:")
		if projectName != "" {
			logger.Info("  Project name: %s", projectName)
		}
		logger.Info("  Template URL: %s", templateBaseURL)
		logger.Info("  Version: %s", templateVersion)
		logger.Info("  Language: %s", templateLanguage)

		return nil
	},
}

InfoCommand defines the "template info" subcommand

View Source
var UpgradeCommand = createUpgradeCommand(
	&defaultTemplateInfoGetter{},
)

UpgradeCommand defines the "template upgrade" subcommand

Functions

func GetTemplateInfo

func GetTemplateInfo() (string, string, string, string, error)

GetTemplateInfo reads the template information from the project config Returns projectName, templateBaseURL, templateVersion, templateLanguage, error

func GetTemplateInfoDefault

func GetTemplateInfoDefault() (string, string, string, string, error)

GetTemplateInfoDefault returns default template information without requiring a config file Returns projectName, templateBaseURL, templateVersion, error

Types

This section is empty.

Jump to

Keyboard shortcuts

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