appinit

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdInit = &cli.Command{
	Name:  "init",
	Usage: "init a sketch Wa module",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "name",
			Aliases: []string{"n"},
			Usage:   "set app name",
			Value:   "hello",
		},
		&cli.StringFlag{
			Name:    "pkgpath",
			Aliases: []string{"p"},
			Usage:   "set pkgpath file",
			Value:   "myapp",
		},
		&cli.BoolFlag{
			Name:  "p5",
			Usage: "p5 example",
		},
		&cli.BoolFlag{
			Name:  "wasm4",
			Usage: "wasm4 game",
		},
		&cli.BoolFlag{
			Name:  "wasi",
			Usage: "wasi example",
		},
		&cli.BoolFlag{
			Name:  "arduino",
			Usage: "arduino nano 33 example",
		},
		&cli.BoolFlag{
			Name:    "update",
			Aliases: []string{"u"},
			Usage:   "update example",
		},
	},

	Action: func(c *cli.Context) error {
		err := InitApp(
			c.String("name"), c.String("pkgpath"),
			c.Bool("p5"), c.Bool("wasm4"), c.Bool("wasi"), c.Bool("arduino"),
			c.Bool("update"),
		)
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
		return nil
	},
}

Functions

func InitApp

func InitApp(name, pkgpath string, isP5App, isWasm4App, isWasiApp, isArduinoApp, update bool) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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