bin flag to install

This commit is contained in:
alessio 2017-09-05 19:39:52 +02:00
parent 339a06a4d3
commit 3b3453da46
6 changed files with 12 additions and 12 deletions

View File

@ -572,7 +572,7 @@ func main() {
return d.Err() return d.Err()
} }
if val != "" { if val != "" {
r.Blueprint.Projects[len(r.Blueprint.Projects)-1].Cmds.Bin.Args = append(r.Blueprint.Projects[len(r.Blueprint.Projects)-1].Cmds.Bin.Args, val) r.Blueprint.Projects[len(r.Blueprint.Projects)-1].Cmds.Install.Args = append(r.Blueprint.Projects[len(r.Blueprint.Projects)-1].Cmds.Install.Args, val)
} }
return nil return nil
}, },
@ -583,7 +583,7 @@ func main() {
if err != nil { if err != nil {
return d.Err() return d.Err()
} }
r.Blueprint.Projects[len(r.Blueprint.Projects)-1].Cmds.Bin.Status = val r.Blueprint.Projects[len(r.Blueprint.Projects)-1].Cmds.Install.Status = val
return nil return nil
}, },
}, },

View File

@ -22,7 +22,7 @@ const (
type Settings struct { type Settings struct {
File string `yaml:"-" json:"-"` File string `yaml:"-" json:"-"`
Make bool `yaml:"-" json:"-"` Make bool `yaml:"-" json:"-"`
Files `yaml:"files" json:"files"` Files `yaml:"files,omitempty" json:"files,omitempty"`
Legacy `yaml:"legacy,omitempty" json:"legacy,omitempty"` Legacy `yaml:"legacy,omitempty" json:"legacy,omitempty"`
Server `yaml:"server,omitempty" json:"server,omitempty"` Server `yaml:"server,omitempty" json:"server,omitempty"`
FileLimit int64 `yaml:"flimit,omitempty" json:"flimit,omitempty"` FileLimit int64 `yaml:"flimit,omitempty" json:"flimit,omitempty"`

View File

@ -113,8 +113,8 @@ func (h *Blueprint) Add(p *cli.Context) error {
Build: Cmd{ Build: Cmd{
Status: p.Bool("build"), Status: p.Bool("build"),
}, },
Bin: Cmd{ Install: Cmd{
Status: !p.Bool("no-bin"), Status: !p.Bool("no-install"),
}, },
Run: !p.Bool("no-run"), Run: !p.Bool("no-run"),
}, },
@ -167,7 +167,7 @@ func (h *Blueprint) List() error {
fmt.Fprintln(style.Output, name, style.Yellow.Regular("Fmt"), ":", style.Magenta.Regular(val.Cmds.Fmt)) fmt.Fprintln(style.Output, name, style.Yellow.Regular("Fmt"), ":", style.Magenta.Regular(val.Cmds.Fmt))
fmt.Fprintln(style.Output, name, style.Yellow.Regular("Generate"), ":", style.Magenta.Regular(val.Cmds.Generate)) fmt.Fprintln(style.Output, name, style.Yellow.Regular("Generate"), ":", style.Magenta.Regular(val.Cmds.Generate))
fmt.Fprintln(style.Output, name, style.Yellow.Regular("Test"), ":", style.Magenta.Regular(val.Cmds.Test)) fmt.Fprintln(style.Output, name, style.Yellow.Regular("Test"), ":", style.Magenta.Regular(val.Cmds.Test))
fmt.Fprintln(style.Output, name, style.Yellow.Regular("Install"), ":", style.Magenta.Regular(val.Cmds.Bin)) fmt.Fprintln(style.Output, name, style.Yellow.Regular("Install"), ":", style.Magenta.Regular(val.Cmds.Install))
fmt.Fprintln(style.Output, name, style.Yellow.Regular("Build"), ":", style.Magenta.Regular(val.Cmds.Build)) fmt.Fprintln(style.Output, name, style.Yellow.Regular("Build"), ":", style.Magenta.Regular(val.Cmds.Build))
fmt.Fprintln(style.Output, name, style.Yellow.Regular("Run"), ":", style.Magenta.Regular(val.Cmds.Run)) fmt.Fprintln(style.Output, name, style.Yellow.Regular("Run"), ":", style.Magenta.Regular(val.Cmds.Run))
if len(val.Args) > 0 { if len(val.Args) > 0 {

View File

@ -131,7 +131,7 @@ func (p *Project) goInstall() (string, error) {
return "", err return "", err
} }
args := []string{"install"} args := []string{"install"}
for _, arg := range p.Cmds.Bin.Args { for _, arg := range p.Cmds.Install.Args {
arr := strings.Fields(arg) arr := strings.Fields(arg)
args = append(args, arr...) args = append(args, arr...)
} }

View File

@ -64,7 +64,7 @@ type Cmds struct {
Fmt Cmd `yaml:"fmt,omitempty" json:"fmt,omitempty"` Fmt Cmd `yaml:"fmt,omitempty" json:"fmt,omitempty"`
Test Cmd `yaml:"test,omitempty" json:"test,omitempty"` Test Cmd `yaml:"test,omitempty" json:"test,omitempty"`
Generate Cmd `yaml:"generate,omitempty" json:"generate,omitempty"` Generate Cmd `yaml:"generate,omitempty" json:"generate,omitempty"`
Bin Cmd `yaml:"bin" json:"bin"` Install Cmd `yaml:"install" json:"install"`
Build Cmd `yaml:"build,omitempty" json:"build,omitempty"` Build Cmd `yaml:"build,omitempty" json:"build,omitempty"`
Run bool `yaml:"run,omitempty" json:"run,omitempty"` Run bool `yaml:"run,omitempty" json:"run,omitempty"`
} }
@ -77,10 +77,10 @@ type Cmd struct {
// Watcher struct defines the livereload's logic // Watcher struct defines the livereload's logic
type Watcher struct { type Watcher struct {
Preview bool `yaml:"preview,omitempty" json:"preview,omitempty"`
Paths []string `yaml:"paths" json:"paths"` Paths []string `yaml:"paths" json:"paths"`
Ignore []string `yaml:"ignore_paths,omitempty" json:"ignore_paths,omitempty"` Exts []string `yaml:"extensions" json:"extensions"`
Exts []string `yaml:"exts" json:"exts"` Ignore []string `yaml:"ignored_paths,omitempty" json:"ignored_paths,omitempty"`
Preview bool `yaml:"preview,omitempty" json:"preview,omitempty"`
Scripts []Command `yaml:"scripts,omitempty" json:"scripts,omitempty"` Scripts []Command `yaml:"scripts,omitempty" json:"scripts,omitempty"`
} }

View File

@ -201,7 +201,7 @@ func (p *Project) watch(watcher watcher) error {
// Install calls an implementation of "go install" // Install calls an implementation of "go install"
func (p *Project) install() error { func (p *Project) install() error {
if p.Cmds.Bin.Status { if p.Cmds.Install.Status {
start := time.Now() start := time.Now()
log.Println(p.pname(p.Name, 1), ":", "Installing..") log.Println(p.pname(p.Name, 1), ":", "Installing..")
stream, err := p.goInstall() stream, err := p.goInstall()