cmd

package
v0.0.0-...-c336e2e Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Build = cli.Command{
	Name:      "build",
	ShortName: "b",
	Usage:     "build pugo.static website",
	Flags: append(commonFlags, cli.BoolFlag{
		Name:  "clean",
		Usage: "clean files in destination dir but not compiled by PuGo",
	}),
	Action: func(ctx *cli.Context) error {
		if ctx.Bool("debug") {
			mylog.EnableTrace = true
		}
		build.Build(ctx.Bool("clean"))
		return nil
	},
}

Build is build command , use to build contents to webpages

View Source
var Server = cli.Command{
	Name:      "server",
	Usage:     "run http server to serve compiled files",
	ShortName: "srv",
	Flags: append(commonFlags, cli.BoolFlag{
		Name:  "static",
		Usage: "only serve static directory, do not build",
	}, cli.BoolFlag{
		Name:  "clean",
		Usage: "clean files in destination dir but not compiled by PuGo",
	}, cli.StringFlag{
		Name:  "addr",
		Usage: "run http server on this address",
		Value: "0.0.0.0:9899",
	}),
	Action: func(ctx *cli.Context) error {
		if !ctx.Bool("static") {
			if ctx.Bool("debug") {
				mylog.EnableTrace = true
			}
			if !build.Build(ctx.Bool("clean")) {
				return nil
			}
		}
		build.Server(ctx.String("addr"))
		return nil
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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