From f098a69e667f94c0a84da616bc866145a275cea8 Mon Sep 17 00:00:00 2001 From: Manuel Coenen Date: Wed, 7 Apr 2021 11:30:18 +0200 Subject: [PATCH] Use latest godsfapi --- cmd/eom/execonmcode.go | 2 +- executor.go | 6 +++++- go.mod | 2 +- go.sum | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cmd/eom/execonmcode.go b/cmd/eom/execonmcode.go index d43d2ee..677419a 100644 --- a/cmd/eom/execonmcode.go +++ b/cmd/eom/execonmcode.go @@ -13,7 +13,7 @@ import ( ) const ( - version = "5.1.2" + version = "5.2.0" ) func main() { diff --git a/executor.go b/executor.go index 9858a9f..43aab65 100644 --- a/executor.go +++ b/executor.go @@ -21,6 +21,7 @@ type Executor struct { socketPath string mode initmessages.InterceptionMode mCodes map[int64]int + filters []string commands Commands execAsync bool returnOutput bool @@ -31,8 +32,10 @@ type Executor struct { func NewExecutor(s Settings) *Executor { mc := make(map[int64]int) + filters := make([]string, 0) for i, m := range s.MCodes { mc[m] = i + filters = append(filters, fmt.Sprintf("M%d", m)) if s.Debug { cmd, args, err := s.Commands.Get(i) if err != nil { @@ -45,6 +48,7 @@ func NewExecutor(s Settings) *Executor { socketPath: s.SocketPath, mode: initmessages.InterceptionMode(s.InterceptionMode), mCodes: mc, + filters: filters, commands: s.Commands, execAsync: s.ExecAsync, returnOutput: s.ReturnOutput, @@ -58,7 +62,7 @@ func (e *Executor) Run() error { ic := connection.InterceptConnection{} ic.Debug = e.trace - err := ic.Connect(e.mode, e.socketPath) + err := ic.Connect(e.mode, nil, e.filters, false, e.socketPath) if err != nil { return err } diff --git a/go.mod b/go.mod index 448a285..4a51a7d 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/wilriker/execonmcode go 1.14 -require github.com/Duet3D/DSF-APIs/godsfapi/v3 v3.1.0 +require github.com/Duet3D/DSF-APIs/godsfapi/v3 v3.2.0 diff --git a/go.sum b/go.sum index c0667ff..61352fa 100644 --- a/go.sum +++ b/go.sum @@ -7,5 +7,7 @@ github.com/Duet3D/DSF-APIs/godsfapi/v2 v2.1.0 h1:MyOKBEE8lpo4pEZtJ4BGgmxH7wttNwf github.com/Duet3D/DSF-APIs/godsfapi/v2 v2.1.0/go.mod h1:4MbBdIOM6SlzCSvtSjpeAj2S62ANmW0fFHeOk8SpjXw= github.com/Duet3D/DSF-APIs/godsfapi/v3 v3.1.0 h1:ojUWUmb86wr81dW5sm2G+nZGKHuSEwRsS7vcQlF7Rm4= github.com/Duet3D/DSF-APIs/godsfapi/v3 v3.1.0/go.mod h1:R1SMeSqiCrj6WuTA0HPjFawfZDtzx0eJToOkCU/8zSk= +github.com/Duet3D/DSF-APIs/godsfapi/v3 v3.2.0 h1:dVOFYs0hJcP4sOAbVlTTzaBI156KaD09Ky2wPNrWY2I= +github.com/Duet3D/DSF-APIs/godsfapi/v3 v3.2.0/go.mod h1:R1SMeSqiCrj6WuTA0HPjFawfZDtzx0eJToOkCU/8zSk= github.com/mitchellh/mapstructure v1.2.2 h1:dxe5oCinTXiTIcfgmZecdCzPmAJKd46KsCWc35r0TV4= github.com/mitchellh/mapstructure v1.2.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=