Skip to content
This repository has been archived by the owner on Sep 5, 2022. It is now read-only.

Commit

Permalink
Use latest godsfapi
Browse files Browse the repository at this point in the history
  • Loading branch information
wilriker committed Apr 7, 2021
1 parent ad42d63 commit f098a69
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/eom/execonmcode.go
Expand Up @@ -13,7 +13,7 @@ import (
)

const (
version = "5.1.2"
version = "5.2.0"
)

func main() {
Expand Down
6 changes: 5 additions & 1 deletion executor.go
Expand Up @@ -21,6 +21,7 @@ type Executor struct {
socketPath string
mode initmessages.InterceptionMode
mCodes map[int64]int
filters []string
commands Commands
execAsync bool
returnOutput bool
Expand All @@ -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 {
Expand All @@ -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,
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -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
2 changes: 2 additions & 0 deletions go.sum
Expand Up @@ -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=

0 comments on commit f098a69

Please sign in to comment.