From 0e78ce904d2869eb5b0f8158f60c2798972b1a58 Mon Sep 17 00:00:00 2001 From: alessio Date: Sun, 24 Jul 2016 01:13:18 +0200 Subject: [PATCH] Add another project by command line --- main.go | 1 + realize/config.go | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/main.go b/main.go index aa98ea8..c6bd8aa 100644 --- a/main.go +++ b/main.go @@ -64,6 +64,7 @@ func main() { Action: func(params *cli.Context) error { y := realize.Config{} err := y.Read() + y.Add(params) return handle(err) }, }, diff --git a/realize/config.go b/realize/config.go index 0c30e3f..40ff7c9 100644 --- a/realize/config.go +++ b/realize/config.go @@ -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) }