command

package
v0.0.0-...-8fe905f Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Build is command of 'build'
	Build = cli.Command{
		Name:  "build",
		Usage: "build static files",
		Flags: []cli.Flag{
			buildSourceFlag,
			buildDestFlag,
			buildThemeFlag,
			buildWatchFlag,
			debugFlag,
		},
		Before: Before,
		Action: func(ctx *cli.Context) error {

			build(newContext(ctx, true), false)
			return nil
		},
	}
)
View Source
var (
	// Deploy is command `deploy`
	Deploy = cli.Command{
		Name:  "deploy",
		Usage: "deploy static website",
	}
)
View Source
var (
	// Doc is command of 'doc'
	Doc = cli.Command{
		Name:  "doc",
		Usage: "run documentation server",
		Flags: []cli.Flag{
			addrFlag,
			debugFlag,
			noServerDocFlag,
		},
		Before: Before,
		Action: docServ,
	}
)
View Source
var (
	// New is command of 'new'
	New = cli.Command{
		Name:  "new",
		Usage: "create new content",
		Flags: []cli.Flag{
			newToFlag,
			debugFlag,
			newOnlyDocFlag,
		},
		Before: Before,
		Action: newContent,
	}
)
View Source
var (
	// Server is command of 'server'
	Server = cli.Command{
		Name:  "server",
		Usage: "server static files",
		Flags: []cli.Flag{
			buildSourceFlag,
			buildDestFlag,
			buildThemeFlag,
			addrFlag,
			serveStaticFlag,
			debugFlag,
			noWatchFlag,
			cli.BoolFlag{
				Name: "profile",
			},
		},
		Before: Before,
		Action: serv,
	}
)
View Source
var (
	// Version is command of 'version'
	Version = cli.Command{
		Name:  "version",
		Usage: "print PuGo Version",
		Action: func(ctx *cli.Context) error {
			fmt.Printf("%v version :\t %s\n", ctx.App.Name, ctx.App.Version)
			fmt.Printf("Go version :\t %s\n", runtime.Version())
			fmt.Printf("Compiled time :\t %s\n", ctx.App.Compiled.Format("2006/01/02 15:04"))

			if vars.Commit != "" {
				fmt.Printf("Commit :\t %s\n", vars.Commit)
			}
			return nil
		},
	}
)

Functions

func Before

func Before(ctx *cli.Context) error

Before set before handler when start run cli.App

Types

This section is empty.

Jump to

Keyboard shortcuts

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