newcmd

package
v3.0.0-...-a5432f4 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BrokenTemplateDescription = "(This template is currently broken)"
)

Variables

This section is empty.

Functions

func ChooseTemplate

func ChooseTemplate(templates []workspace.Template, opts display.Options) (workspace.Template, error)

ChooseTemplate will prompt the user to choose amongst the available templates.

func ErrorIfNotEmptyDirectory

func ErrorIfNotEmptyDirectory(path string) error

ErrorIfNotEmptyDirectory returns an error if path is not empty.

func GetStack

func GetStack(ctx context.Context, b backend.Backend,
	stack string, opts display.Options,
) (backend.Stack, string, string, error)

GetStack gets a stack and the project name & description, or returns nil if the stack doesn't exist.

func HandleConfig

func HandleConfig(
	ctx context.Context,
	ssml cmdStack.SecretsManagerLoader,
	ws pkgWorkspace.Context,
	prompt promptForValueFunc,
	project *workspace.Project,
	s backend.Stack,
	templateNameOrURL string,
	template workspace.Template,
	configArray []string,
	yes bool,
	path bool,
	opts display.Options,
) error

HandleConfig handles prompting for config values (as needed) and saving config.

func InstallDependencies

func InstallDependencies(ctx *plugin.Context, runtime *workspace.ProjectRuntimeInfo, main string) error

InstallDependencies will install dependencies for the project, e.g. by running `npm install` for nodejs projects.

func NewNewCmd

func NewNewCmd() *cobra.Command

NewNewCmd creates a New command with default dependencies. Intentionally disabling here for cleaner err declaration/assignment.

func ParseConfig

func ParseConfig(configArray []string, path bool) (config.Map, error)

ParseConfig parses the config values passed via command line flags. These are passed as `-c aws:region=us-east-1 -c foo:bar=blah` and end up in configArray as ["aws:region=us-east-1", "foo:bar=blah"]. This function converts the array into a config.Map.

func PromptAndCreateStack

func PromptAndCreateStack(ctx context.Context, ws pkgWorkspace.Context, b backend.Backend, prompt promptForValueFunc,
	stack string, root string, setCurrent bool, yes bool, opts display.Options,
	secretsProvider string,
) (backend.Stack, error)

PromptAndCreateStack creates and returns a new stack (prompting for the name as needed).

func SaveConfig

func SaveConfig(ws pkgWorkspace.Context, stack backend.Stack, c config.Map) error

SaveConfig saves the config for the stack.

func UseSpecifiedDir

func UseSpecifiedDir(dir string) (string, error)

Ensure the directory exists and uses it as the current working directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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