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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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