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 {
|
||||
y := realize.Config{}
|
||||
err := y.Read()
|
||||
y.Add(params)
|
||||
return handle(err)
|
||||
},
|
||||
},
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue