new config fixed

This commit is contained in:
alessio 2017-04-01 19:33:21 +02:00
parent 3c5985245f
commit 98fa2c02d6
1 changed files with 21 additions and 4 deletions

View File

@ -109,11 +109,11 @@ func main() {
Authors: []*cli.Author{ Authors: []*cli.Author{
{ {
Name: "Alessio Pracchia", Name: "Alessio Pracchia",
Email: "pracchia@hastegit", Email: "pracchia@hastega.it",
}, },
{ {
Name: "Daniele Conventi", Name: "Daniele Conventi",
Email: "conventi@hastegit", Email: "conventi@hastega.it",
}, },
}, },
Usage: r.Description, Usage: r.Description,
@ -216,6 +216,23 @@ func main() {
if err != nil { if err != nil {
return d.Err() return d.Err()
} else if val { } else if val {
r.Settings = c.Settings{
Config: c.Config{
Create: true,
},
Resources: c.Resources{
Config: config,
Outputs: outputs,
Logs: logs,
Errors: errs,
},
Server: c.Server{
Status: false,
Open: false,
Host: host,
Port: port,
},
}
r.Blueprint.Projects = r.Blueprint.Projects[len(r.Blueprint.Projects):] r.Blueprint.Projects = r.Blueprint.Projects[len(r.Blueprint.Projects):]
} }
return nil return nil
@ -385,12 +402,12 @@ func main() {
{ {
Before: func(d i.Context) error { Before: func(d i.Context) error {
d.SetDef(true, r.Green.Regular("(y)")) d.SetDef(true, r.Green.Regular("(y)"))
d.SetEnd("!done") d.SetEnd("!")
return nil return nil
}, },
Quest: i.Quest{ Quest: i.Quest{
Options: r.Yellow.Regular("[y/n]"), Options: r.Yellow.Regular("[y/n]"),
Msg: "Would you want to " + r.Colors.Magenta.Regular("add a new project") + " ?", Msg: "Would you want to " + r.Colors.Magenta.Regular("add a new project") + "? (insert '!' to stop)",
Resolve: func(d i.Context) bool { Resolve: func(d i.Context) bool {
val, _ := d.Ans().Bool() val, _ := d.Ans().Bool()
if val { if val {