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 { Action: func(params *cli.Context) error {
y := realize.Config{} y := realize.Config{}
err := y.Read() err := y.Read()
y.Add(params)
return handle(err) return handle(err)
}, },
}, },

View File

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