create

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package create implements the bcli create subcommand.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteCreateJSON added in v0.2.5

func WriteCreateJSON(w io.Writer, result CreateResult) error

WriteCreateJSON writes a create command result as JSON.

Types

type Command

type Command struct {
	RootPath         *string `` /* 159-byte string literal not displayed */
	ProjectDirPrefix *string `` /* 161-byte string literal not displayed */
	GitLocation      *string `short:"g" help:"Git host and owner prefix for the generated module path"`
	NoGoGetUpdate    bool    `          help:"Skip the 'go get -u ./...' post step"`
	NoGoModTidy      bool    `          help:"Skip the 'go mod tidy' post step"`
	NoGitInit        bool    `          help:"Skip the 'git init' post step"`
	NoGitCommit      bool    `          help:"Skip the 'git commit' post step"`
	InPlace          bool    `` /* 189-byte string literal not displayed */
	JSON             bool    `` /* 186-byte string literal not displayed */
	Name             string  `` /* 208-byte string literal not displayed */
	Description      string  `` /* 208-byte string literal not displayed */
}

Command creates a new starter CLI project.

func (*Command) AfterApply

func (c *Command) AfterApply(cfg *bcliconfig.Config) error

AfterApply applies command-specific flag overrides to the shared app config.

func (*Command) Run

func (c *Command) Run(log zerolog.Logger, cfg *bcliconfig.Config) error

Run generates the project scaffold and executes the configured post steps.

type CreateResult added in v0.2.5

type CreateResult struct {
	Project     string           `json:"project"`
	Description string           `json:"description"`
	ModulePath  string           `json:"module_path"`
	TargetPath  string           `json:"target_path"`
	InPlace     bool             `json:"inplace"`
	PostSteps   []PostStepResult `json:"post_steps"`
}

CreateResult describes a project created by the create command.

func NewCreateResult added in v0.2.5

func NewCreateResult(
	name string,
	description string,
	inPlace bool,
	result projectgen.Result,
	plannedSteps []poststep.PostStep,
) (CreateResult, error)

NewCreateResult returns the JSON-serializable result for a generated project.

type PostStepResult added in v0.2.5

type PostStepResult struct {
	Name string `json:"name"`
	Ran  bool   `json:"ran"`
}

PostStepResult describes whether a create command post step ran.

func PostStepResults added in v0.2.5

func PostStepResults(plannedSteps []poststep.PostStep) []PostStepResult

PostStepResults returns the standard create command post-step result set.

Jump to

Keyboard shortcuts

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