corecmd

package
v0.57.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// CommandName is the main command's binary name.
	CommandName = "hugoreleaser"

	// The prefix used for any flag overrides.
	EnvPrefix = "HUGORELEASER"

	// The env file to look for in the current directory.
	EnvFile = "hugoreleaser.env"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandHandler

type CommandHandler interface {
	Exec(ctx context.Context, args []string) error
	Init() error
}

type Core

type Core struct {
	// The parsed config.
	Config config.Config

	// The common Info logger.
	InfoLog logg.LevelLogger

	// The common Warn logger.
	WarnLog logg.LevelLogger

	// The common Error logger.
	ErrorLog logg.LevelLogger

	// No output to stdout.
	Quiet bool

	// Trial run, no builds or releases.
	Try bool

	// The Git tag to use for the release.
	// This tag will eventually be created at release time if it does not exist.
	Tag string

	// Paths to build/release.
	Paths                 stringFlags
	PathsBuildsCompiled   matchers.Matcher
	PathsArchivesCompiled matchers.Matcher
	PathsReleasesCompiled matchers.Matcher

	// Abolute path to the project root.
	ProjectDir string

	// Absolute path to the dist directory.
	DistDir string

	// We store builds in ./dist/<project>/<ref>/<DistRootBuilds>/<os>/<arch>/<build
	DistRootBuilds string

	// We store archives in ./dist/<project>/<ref>/<DistRootArchives>/<os>/<arch>/<build
	DistRootArchives string

	// We store release artifacts in ./dist/<project>/<ref>/<DistRootReleases>/<release.dir>
	DistRootReleases string

	// The config file to use.
	ConfigFile string

	// Number of parallel tasks.
	NumWorkers int

	// Global timeout for all commands.
	Timeout time.Duration

	// The global workforce.
	Workforce *workers.Workforce

	// Archive plugins started and ready to use.
	PluginsRegistryArchive map[string]*execrpc.Client[archiveplugin.Request, archiveplugin.Response]
}

Core holds common config settings and objects.

func New

func New() (*ffcli.Command, *Core)

New constructs a usable ffcli.Command and an empty Config. The config will be set after a successful parse. The caller must

func (*Core) Close

func (c *Core) Close() error

func (*Core) Exec

func (c *Core) Exec(context.Context, []string) error

Exec function for this command.

func (*Core) Init

func (c *Core) Init() error

func (*Core) PreInit

func (c *Core) PreInit() error

PreInit is called before the flags are parsed.

func (*Core) RegisterFlags

func (c *Core) RegisterFlags(fs *flag.FlagSet)

RegisterFlags registers the flag fields into the provided flag.FlagSet. This helper function allows subcommands to register the root flags into their flagsets, creating "global" flags that can be passed after any subcommand at the commandline.

func (*Core) RunGo added in v0.6.0

func (c *Core) RunGo(ctx context.Context, envKeyVals, args []string, stderr io.Writer) error

Jump to

Keyboard shortcuts

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