cli

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2016 License: GPL-3.0 Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Green, Red, RedS, Blue, BlueS, Yellow, YellowS, Magenta, MagentaS = color.New(color.FgGreen, color.Bold).SprintFunc(),
	color.New(color.FgRed, color.Bold).SprintFunc(),
	color.New(color.FgRed).SprintFunc(),
	color.New(color.FgBlue, color.Bold).SprintFunc(),
	color.New(color.FgBlue).SprintFunc(),
	color.New(color.FgYellow, color.Bold).SprintFunc(),
	color.New(color.FgYellow).SprintFunc(),
	color.New(color.FgMagenta, color.Bold).SprintFunc(),
	color.New(color.FgMagenta).SprintFunc()

Functions

func WorkingDir

func WorkingDir() string

WorkingDir returns the name last element of the working directory path

Types

type Blueprint

type Blueprint struct {
	Projects []Project         `yaml:"projects,omitempty"`
	Files    map[string]string `yaml:"-"`
	Sync     chan string       `yaml:"-"`
}

Projects struct contains a projects list

func (*Blueprint) Add

func (h *Blueprint) Add(params *cli.Context) error

Add a new project

func (*Blueprint) Clean

func (h *Blueprint) Clean()

Clean duplicate projects

func (*Blueprint) Create

func (h *Blueprint) Create() error

Create and unmarshal yaml config file

func (*Blueprint) Fast

func (h *Blueprint) Fast(params *cli.Context) error

Fast method run a project from his working directory without makes a config file

func (*Blueprint) Insert

func (h *Blueprint) Insert(params *cli.Context) error

Inserts a new project in the list

func (*Blueprint) List

func (h *Blueprint) List() error

List of all the projects

func (*Blueprint) Read

func (h *Blueprint) Read() error

Read, Check and remove duplicates from the config file

func (*Blueprint) Remove

func (h *Blueprint) Remove(params *cli.Context) error

Remove a project

func (*Blueprint) Run

func (h *Blueprint) Run() error

Watch method adds the given paths on the Watcher

type Buffer

type Buffer struct {
	StdOut []BufferOut
	StdLog []BufferOut
	StdErr []BufferOut
}

Buffer struct for buffering outputs

type BufferOut

type BufferOut struct {
	Time time.Time
	Text string
}

type Project

type Project struct {
	LastChangedOn time.Time `yaml:"-"`

	Name    string   `yaml:"app_name,omitempty"`
	Path    string   `yaml:"app_path,omitempty"`
	Run     bool     `yaml:"app_run,omitempty"`
	Bin     bool     `yaml:"app_bin,omitempty"`
	Build   bool     `yaml:"app_build,omitempty"`
	Fmt     bool     `yaml:"app_fmt,omitempty"`
	Test    bool     `yaml:"app_test,omitempty"`
	Params  []string `yaml:"app_params,omitempty"`
	Watcher Watcher  `yaml:"app_watcher,omitempty"`
	Buffer  Buffer   `yaml:"-"`
	// contains filtered or unexported fields
}

Project defines the informations of a single project

func (*Project) Cmd

func (p *Project) Cmd(cmds []string) (errors []error)

Cmd exec a list of defined commands

func (*Project) GoBuild

func (p *Project) GoBuild() (string, error)

GoBuild is an implementation of the "go build"

func (*Project) GoFmt

func (p *Project) GoFmt(path string) (io.Writer, error)

GoFmt is an implementation of the gofmt

func (*Project) GoInstall

func (p *Project) GoInstall() (string, error)

GoInstall is an implementation of the "go install"

func (*Project) GoRun

func (p *Project) GoRun(channel chan bool, runner chan bool, wr *sync.WaitGroup) error

GoRun is an implementation of the bin execution

func (*Project) GoTest

func (p *Project) GoTest(path string) (io.Writer, error)

GoTest is an implementation of the go test

type Watcher

type Watcher struct {
	// different before and after on re-run?
	Before  []string        `yaml:"before,omitempty"`
	After   []string        `yaml:"after,omitempty"`
	Paths   []string        `yaml:"paths,omitempty"`
	Ignore  []string        `yaml:"ignore_paths,omitempty"`
	Exts    []string        `yaml:"exts,omitempty"`
	Preview bool            `yaml:"preview,omitempty"`
	Output  map[string]bool `yaml:"output,omitempty"`
}

Watcher struct defines the livereload's logic

Jump to

Keyboard shortcuts

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