Add another project by command line
This commit is contained in:
parent
512defe2b0
commit
0e78ce904d
1
main.go
1
main.go
|
@ -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)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue