refactoring
This commit is contained in:
parent
648fccf000
commit
560d58dfa0
@ -24,9 +24,8 @@ func (h *Blueprint) Run(p *cli.Context) error {
|
|||||||
if p.String("name") != "" && h.Projects[k].Name != p.String("name") {
|
if p.String("name") != "" && h.Projects[k].Name != p.String("name") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
tools := tools{}
|
|
||||||
if element.Cmds.Fmt {
|
if element.Cmds.Fmt {
|
||||||
tools.Fmt = tool{
|
h.Projects[k].tools.Fmt = tool{
|
||||||
status: &h.Projects[k].Cmds.Fmt,
|
status: &h.Projects[k].Cmds.Fmt,
|
||||||
cmd: "gofmt",
|
cmd: "gofmt",
|
||||||
options: []string{"-s", "-w", "-e"},
|
options: []string{"-s", "-w", "-e"},
|
||||||
@ -34,7 +33,7 @@ func (h *Blueprint) Run(p *cli.Context) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if element.Cmds.Generate {
|
if element.Cmds.Generate {
|
||||||
tools.Generate = tool{
|
h.Projects[k].tools.Generate = tool{
|
||||||
status: &h.Projects[k].Cmds.Generate,
|
status: &h.Projects[k].Cmds.Generate,
|
||||||
cmd: "go",
|
cmd: "go",
|
||||||
options: []string{"generate"},
|
options: []string{"generate"},
|
||||||
@ -42,7 +41,7 @@ func (h *Blueprint) Run(p *cli.Context) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if element.Cmds.Test {
|
if element.Cmds.Test {
|
||||||
tools.Test = tool{
|
h.Projects[k].tools.Test = tool{
|
||||||
status: &h.Projects[k].Cmds.Test,
|
status: &h.Projects[k].Cmds.Test,
|
||||||
cmd: "go",
|
cmd: "go",
|
||||||
options: []string{"test"},
|
options: []string{"test"},
|
||||||
@ -50,14 +49,13 @@ func (h *Blueprint) Run(p *cli.Context) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if element.Cmds.Vet {
|
if element.Cmds.Vet {
|
||||||
tools.Vet = tool{
|
h.Projects[k].tools.Vet = tool{
|
||||||
status: &h.Projects[k].Cmds.Vet,
|
status: &h.Projects[k].Cmds.Vet,
|
||||||
cmd: "go",
|
cmd: "go",
|
||||||
options: []string{"vet"},
|
options: []string{"vet"},
|
||||||
name: "Go Vet",
|
name: "Go Vet",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
h.Projects[k].tools = tools
|
|
||||||
h.Projects[k].parent = h
|
h.Projects[k].parent = h
|
||||||
h.Projects[k].path = h.Projects[k].Path
|
h.Projects[k].path = h.Projects[k].Path
|
||||||
|
|
||||||
@ -131,7 +129,7 @@ func (h *Blueprint) Remove(p *cli.Context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return errors.New("no project found")
|
return errors.New("No project found.")
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of all the projects
|
// List of all the projects
|
||||||
@ -193,5 +191,5 @@ func (h *Blueprint) check() error {
|
|||||||
h.Clean()
|
h.Clean()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return errors.New("There are no projects")
|
return errors.New("There are no projects.")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user