Add another project by command line

This commit is contained in:
alessio 2016-07-24 01:13:18 +02:00
parent 512defe2b0
commit 0e78ce904d
2 changed files with 11 additions and 9 deletions

View File

@ -64,6 +64,7 @@ func main() {
Action: func(params *cli.Context) error {
y := realize.Config{}
err := y.Read()
y.Add(params)
return handle(err)
},
},

View File

@ -92,14 +92,15 @@ func (h *Config) Create() error{
// Add another project
func (h *Config) Add(params *cli.Context) {
//new := Project{
// Main: params.String("main"),
// Run: params.Bool("run"),
// Build: params.Bool("build"),
// Watcher: Watcher{
// Paths: []string{"/"},
// Exts: []string{"go"},
// },
//}
new := Project{
Main: params.String("main"),
Run: params.Bool("run"),
Build: params.Bool("build"),
Watcher: Watcher{
Paths: []string{"/"},
Exts: []string{"go"},
},
}
h.Projects = append(h.Projects, new)
}