create

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command *cli.Command = &cli.Command{
	Name:    commandName,
	Aliases: []string{"c"},
	Usage:   "Create a new project",
	Flags: []cli.Flag{
		shared.SystemNameFlag(
			"The name of your system (Kubernetes namespace) you want to create your application in.",
			true,
		),
		shared.ApplicationNameFlag(
			"The name of the application you want to create.",
		),
		shared.RuntimeCloudProviderFlag(),
		&cli.StringFlag{
			Name:    "template",
			Aliases: []string{"t"},
			Usage: fmt.Sprintf(
				"The template to use for the project. Supported templates are: %s",
				strings.Join(Templates.Values(), ", "),
			),
			Value: Dotnet8WebApi.Value,
			Action: func(ctx context.Context, c *cli.Command, template string) error {
				parsed := Templates.Parse(template)

				if parsed == nil {
					return cli.Exit(
						fmt.Sprintf(
							"Template '%s' is not supported. Supported templates are: %s",
							template,
							Templates.Values(),
						),
						1,
					)
				}

				return nil
			},
		},
		&cli.StringFlag{
			Name:    "default-branch",
			Aliases: []string{"b"},
			Usage:   "The default branch of the repository",
			Value:   "trunk",
		},
		&cli.StringFlag{
			Name:    "github-actions-directory",
			Aliases: []string{"G"},
			Usage:   "The root directory of your GitHub repository. The path specified will be prepended to '.github/workflows'.",
		},
	},
	Action: Create,
}

Functions

func Create

func Create(ctx context.Context, c *cli.Command) error

Types

type Template added in v0.21.0

type Template enum.Member[string]
var (
	Dotnet8WebApi Template = Template{"dotnet8-webapi"}
	// Dotnet8WebApp Template = Template{"dotnet8-webapp"}
	Dotnet8Worker Template = Template{"dotnet8-worker"}
	// Go            Template = Template{"go"}
	Templates = enum.New(
		Dotnet8WebApi,

		Dotnet8Worker,
	)
)

Jump to

Keyboard shortcuts

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