publish

package
v0.0.0-...-94aa108 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Publish = &gcmd.Command{
		Name:  "publish",
		Usage: "publish",
		Brief: "publish files",
		Examples: `publish -h   // get help information
publish -f "config-example.yaml:config.yaml"
publish -d "sourceDir:dstDir"
publish -f "config-example.yaml:config.yaml" --force
publish -f "config-example.yaml:config.yaml" -p
`,
		Arguments: []gcmd.Argument{
			{Name: "dir", Short: "d", Brief: "publish dir parameters, the format is 'src:dst', the target address can only be the project directory"},
			{Name: "file", Short: "f", Brief: "publish file parameters, the format is 'src:dst', the target address can only be the project directory"},
			{Name: "force", Brief: "replace if the target file exists, skip by default", Orphan: true},
			{Name: "print", Short: "p", Brief: "show print information", Orphan: true},
		},
		Func: func(ctx context.Context, parser *gcmd.Parser) (err error) {
			if len(parser.GetOptAll()) == 0 {
				gcmd.CommandFromCtx(ctx).Print()
				return nil
			}
			logger = glog.New()
			force = parser.GetOpt("force") != nil
			showPrint = parser.GetOpt("print") != nil
			if !showPrint {
				logger.SetLevel(glog.LEVEL_CRIT)
			}
			return publishHandler(ctx, parser)
		},
	}
)

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