summaryrefslogtreecommitdiffstats
path: root/cmd-exec.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd-exec.go')
-rw-r--r--cmd-exec.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd-exec.go b/cmd-exec.go
index 1d121c3..c02496b 100644
--- a/cmd-exec.go
+++ b/cmd-exec.go
@@ -61,6 +61,7 @@ func exec(ctx *cli.Context) error {
exitChan := make(chan exitResult, 1)
IOsk.On("disconnection", func(err error) {
+ Log.Debugf("WS disconnection event with err: %v\n", err)
exitChan <- exitResult{err, 2}
})
@@ -85,6 +86,15 @@ func exec(ctx *cli.Context) error {
exitChan <- exitResult{ev.Error, ev.Code}
})
+ IOsk.On(apiv1.EVTProjectChange, func(ev apiv1.EventMsg) {
+ prj, _ := ev.DecodeProjectConfig()
+ Log.Infof("Event %v (%v): %v", ev.Type, ev.Time, prj)
+ })
+ evReg := apiv1.EventRegisterArgs{Name: apiv1.EVTProjectChange}
+ if err := HTTPCli.Post("/events/register", &evReg, nil); err != nil {
+ return cli.NewExitError(err, 1)
+ }
+
// Retrieve the project definition
prj := apiv1.ProjectConfig{}
if err := HTTPCli.Get("/projects/"+prjID, &prj); err != nil {