no conf method removed
This commit is contained in:
parent
6dda3c76d1
commit
d8396809e8
20
realize.go
20
realize.go
|
@ -68,21 +68,20 @@ func main() {
|
|||
},
|
||||
Action: func(p *cli.Context) error {
|
||||
polling(p, &r.Legacy)
|
||||
noconf(p, &r.Settings)
|
||||
if err := insert(p, &r.Blueprint); err != nil {
|
||||
return err
|
||||
}
|
||||
if !p.Bool("no-config") {
|
||||
if err := r.Record(r); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := r.Server.Start(p); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := r.Blueprint.Run(p); err != nil {
|
||||
return err
|
||||
}
|
||||
if r.Make {
|
||||
if err := r.Record(r); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
},
|
||||
Before: before,
|
||||
|
@ -145,7 +144,6 @@ func main() {
|
|||
return d.Err()
|
||||
} else if val {
|
||||
r.Settings = settings.Settings{
|
||||
Make: true,
|
||||
File: settings.File,
|
||||
Server: settings.Server{
|
||||
Status: false,
|
||||
|
@ -1110,7 +1108,6 @@ func before(*cli.Context) error {
|
|||
r = realize{
|
||||
Sync: make(chan string),
|
||||
Settings: settings.Settings{
|
||||
Make: true,
|
||||
File: settings.File,
|
||||
Server: settings.Server{
|
||||
Status: false,
|
||||
|
@ -1148,13 +1145,6 @@ func polling(c *cli.Context, s *settings.Legacy) {
|
|||
}
|
||||
}
|
||||
|
||||
// Check for the noconf option
|
||||
func noconf(c *cli.Context, s *settings.Settings) {
|
||||
if c.Bool("no-config") {
|
||||
s.Make = false
|
||||
}
|
||||
}
|
||||
|
||||
// Insert a project if there isn't already one
|
||||
func insert(c *cli.Context, b *watcher.Blueprint) error {
|
||||
if len(b.Projects) <= 0 {
|
||||
|
|
|
@ -29,17 +29,6 @@ func TestBefore(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestNoConf(t *testing.T) {
|
||||
settings := settings.Settings{Make: true}
|
||||
set := flag.NewFlagSet("test", 0)
|
||||
set.Bool("no-config", true, "")
|
||||
params := cli.NewContext(nil, set, nil)
|
||||
noconf(params, &settings)
|
||||
if settings.Make == true {
|
||||
t.Fatal("Expected", false, "Instead", true)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPolling(t *testing.T) {
|
||||
settings := settings.Legacy{}
|
||||
set := flag.NewFlagSet("test", 0)
|
||||
|
|
Loading…
Reference in New Issue