go clean and fix support
This commit is contained in:
parent
11f74c1ce4
commit
ae5497149d
|
@ -49,7 +49,7 @@ Various operations can be programmed for each project, which can be executed at
|
|||
- Custom arguments to pass at each project
|
||||
- Docker support (only with polling watcher)
|
||||
- Live reload on file change (extensions and paths customizable)
|
||||
- Support for most go commands (install, build, run, vet, test, fmt and much more)
|
||||
- Support for most go commands (install, build, run, vet, test, fmt, fix, clean)
|
||||
- Web panel for a smart control of the workflow
|
||||
|
||||
Next features and informations
|
||||
|
|
88
realize.go
88
realize.go
|
@ -509,6 +509,94 @@ func main() {
|
|||
return nil
|
||||
},
|
||||
},
|
||||
{
|
||||
Before: func(d interact.Context) error {
|
||||
d.SetDef(false, green.regular("(n)"))
|
||||
return nil
|
||||
},
|
||||
Quest: interact.Quest{
|
||||
Options: yellow.regular("[y/n]"),
|
||||
Msg: "Enable go fix",
|
||||
Resolve: func(d interact.Context) bool {
|
||||
val, _ := d.Ans().Bool()
|
||||
return val
|
||||
},
|
||||
},
|
||||
Subs: []*interact.Question{
|
||||
{
|
||||
Before: func(d interact.Context) error {
|
||||
d.SetDef("", green.regular("(none)"))
|
||||
return nil
|
||||
},
|
||||
Quest: interact.Quest{
|
||||
Options: yellow.regular("[string]"),
|
||||
Msg: "Fix additional arguments",
|
||||
},
|
||||
Action: func(d interact.Context) interface{} {
|
||||
val, err := d.Ans().String()
|
||||
if err != nil {
|
||||
return d.Err()
|
||||
}
|
||||
if val != "" {
|
||||
r.Schema[len(r.Schema)-1].Cmds.Fix.Args = append(r.Schema[len(r.Schema)-1].Cmds.Fix.Args, val)
|
||||
}
|
||||
return nil
|
||||
},
|
||||
},
|
||||
},
|
||||
Action: func(d interact.Context) interface{} {
|
||||
val, err := d.Ans().Bool()
|
||||
if err != nil {
|
||||
return d.Err()
|
||||
}
|
||||
r.Schema[len(r.Schema)-1].Cmds.Fix.Status = val
|
||||
return nil
|
||||
},
|
||||
},
|
||||
{
|
||||
Before: func(d interact.Context) error {
|
||||
d.SetDef(false, green.regular("(n)"))
|
||||
return nil
|
||||
},
|
||||
Quest: interact.Quest{
|
||||
Options: yellow.regular("[y/n]"),
|
||||
Msg: "Enable go clean",
|
||||
Resolve: func(d interact.Context) bool {
|
||||
val, _ := d.Ans().Bool()
|
||||
return val
|
||||
},
|
||||
},
|
||||
Subs: []*interact.Question{
|
||||
{
|
||||
Before: func(d interact.Context) error {
|
||||
d.SetDef("", green.regular("(none)"))
|
||||
return nil
|
||||
},
|
||||
Quest: interact.Quest{
|
||||
Options: yellow.regular("[string]"),
|
||||
Msg: "Clean additional arguments",
|
||||
},
|
||||
Action: func(d interact.Context) interface{} {
|
||||
val, err := d.Ans().String()
|
||||
if err != nil {
|
||||
return d.Err()
|
||||
}
|
||||
if val != "" {
|
||||
r.Schema[len(r.Schema)-1].Cmds.Clean.Args = append(r.Schema[len(r.Schema)-1].Cmds.Clean.Args, val)
|
||||
}
|
||||
return nil
|
||||
},
|
||||
},
|
||||
},
|
||||
Action: func(d interact.Context) interface{} {
|
||||
val, err := d.Ans().Bool()
|
||||
if err != nil {
|
||||
return d.Err()
|
||||
}
|
||||
r.Schema[len(r.Schema)-1].Cmds.Clean.Status = val
|
||||
return nil
|
||||
},
|
||||
},
|
||||
{
|
||||
Before: func(d interact.Context) error {
|
||||
d.SetDef(false, green.regular("(n)"))
|
||||
|
|
Loading…
Reference in New Issue