Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultProjectName = "MyProject" DefaultProjectNamespace = "my_namespace" DefaultProjectEntrypoint = "src/main.mcb" )
Variables ¶
View Source
var BuildCommand = &cli.Command{ Name: "build", Usage: "Compile the project into a datapack", Flags: []cli.Flag{ &cli.StringFlag{ Name: "config", Value: "project.toml", Usage: "Path to the project config file", }, &cli.StringFlag{ Name: "output", Value: "build", Usage: "Output directory. The resulting datapack will be inside this directory as <output>/<project_name>", }, &cli.BoolFlag{ Name: "enable-traces", Value: false, Usage: "Enable traces", }, }, Action: func(ctx context.Context, cmd *cli.Command) error { data := ctx.Value("data").(*Data) return Build(cmd, data.Stdlib, data.Embedded) }, }
View Source
var InitCommand = &cli.Command{ Name: "init", Usage: "Initialize a new project", Flags: []cli.Flag{ &cli.StringFlag{ Name: "project-name", Value: DefaultProjectName, Usage: "Name of the project", }, &cli.StringFlag{ Name: "namespace", Value: DefaultProjectNamespace, Usage: "Namespace of the project", }, &cli.StringFlag{ Name: "entrypoint", Value: DefaultProjectEntrypoint, Usage: "Entrypoint of the project. The compiler will look for this file to start compiling", }, &cli.BoolFlag{ Name: "force", Value: false, Usage: "Force overwrite existing files", }, &gitInitFlag, }, Action: func(ctx context.Context, cmd *cli.Command) error { return Init(cmd) }, }
Functions ¶
func DebugFlagHandler ¶ added in v0.0.6
func DebugFlagHandler(cmd *cli.Command)
Types ¶
Click to show internal directories.
Click to hide internal directories.