cmdutil

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrReload = errors.New("reloading config")

ErrReload is an error to return from a command if you want to reload and run again

Functions

func ForDefaultClient

func ForDefaultClient(flags Flags, args []string, handler func(Ctx) error) error

ForDefaultClient will run in a context that runs of any available config including defaults

func ForEachClient

func ForEachClient(flags Flags, args []string, handler func(Ctx) error) error

ForEachClient will generate a command context for all the available environments and run a command in each of those contexts

func ForSingleClient

func ForSingleClient(flags Flags, args []string, handler func(Ctx) error) error

ForSingleClient will generate a command context for all the available environments, and run a command for the first context. If more than one environment was specified, then an error will be returned.

Types

type Ctx

type Ctx struct {
	Shop   shopify.Shop
	Conf   config
	Client shopifyClient
	Flags  Flags
	Env    *env.Env
	Args   []string
	Log    *log.Logger
	ErrLog *log.Logger

	Bar *mpb.Bar
	// contains filtered or unexported fields
}

Ctx is a specific context that a command will run in

func (*Ctx) DoneTask

func (ctx *Ctx) DoneTask()

DoneTask will mark one unit of work complete. If the context has a progress bar then it will increment it.

func (*Ctx) StartProgress

func (ctx *Ctx) StartProgress(count int)

StartProgress will create a new progress bar for the running context with the total amount of tasks as the count

type Flags

type Flags struct {
	ConfigPath            string
	Environments          stringArgArray
	Directory             string
	Password              string
	ThemeID               string
	Domain                string
	Proxy                 string
	Timeout               time.Duration
	Verbose               bool
	DisableUpdateNotifier bool
	IgnoredFiles          stringArgArray
	Ignores               stringArgArray
	DisableIgnore         bool
	NotifyFile            string
	AllEnvs               bool
	Version               string
	Prefix                string
	URL                   string
	Name                  string
	Edit                  bool
	With                  string
	List                  bool
	NoDelete              bool
}

Flags encapsulates all the possible flags that can be set in the themekit command line. Some of the values are used across different commands

Directories

Path Synopsis
Code generated by mockery v1.0.0.
Code generated by mockery v1.0.0.

Jump to

Keyboard shortcuts

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