diff --git a/snap/local/hooks/cmd/configure/configure.go b/snap/local/hooks/cmd/configure/configure.go index e1ec60d8..6f8c7eff 100644 --- a/snap/local/hooks/cmd/configure/configure.go +++ b/snap/local/hooks/cmd/configure/configure.go @@ -51,6 +51,12 @@ func main() { } + log.SetComponentName("configure") + if err := options.ProcessAppConfig("device-mqtt"); err != nil { + hooks.Error(fmt.Sprintf("could not process options: %v", err)) + os.Exit(1) + } + // read env var override configuration envJSON, err = cli.Config(hooks.EnvConfig) if err != nil { @@ -101,10 +107,4 @@ func main() { hooks.Error(fmt.Sprintf("Invalid value for 'autostart' : %s", autostart)) os.Exit(1) } - - log.SetComponentName("configure") - if err := options.ProcessAppConfig("device-mqtt"); err != nil { - hooks.Error(fmt.Sprintf("could not process options: %v", err)) - os.Exit(1) - } } diff --git a/snap/local/hooks/go.mod b/snap/local/hooks/go.mod index 44263d4a..0442862f 100644 --- a/snap/local/hooks/go.mod +++ b/snap/local/hooks/go.mod @@ -3,3 +3,5 @@ module github.com/edgexfoundry/device-mqtt-go/hooks require github.com/canonical/edgex-snap-hooks/v2 v2.2.0-beta.2.0.20220420075917-7fdbcd41ba0b go 1.17 + +replace github.com/canonical/edgex-snap-hooks/v2 => github.com/farshidtz/edgex-snap-hooks/v2 v2.0.6-0.20220422071606-d43ccc771100 diff --git a/snap/local/hooks/go.sum b/snap/local/hooks/go.sum index 85c7acbd..4d4d0c11 100644 --- a/snap/local/hooks/go.sum +++ b/snap/local/hooks/go.sum @@ -1,7 +1,7 @@ -github.com/canonical/edgex-snap-hooks/v2 v2.2.0-beta.2.0.20220420075917-7fdbcd41ba0b h1:vKrKzgdZo3kk0mptvQ1vvUUUQ2eYjE+nDMhT2tC9UJw= -github.com/canonical/edgex-snap-hooks/v2 v2.2.0-beta.2.0.20220420075917-7fdbcd41ba0b/go.mod h1:rOxrwdYL7hJDhxFH3uV+nVgLPjWOhJWgM5PRD5YG1jI= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/farshidtz/edgex-snap-hooks/v2 v2.0.6-0.20220422071606-d43ccc771100 h1:LpQTdrArglZpFxKC7o8WcddLoAeO4CBt32DyeVHtGys= +github.com/farshidtz/edgex-snap-hooks/v2 v2.0.6-0.20220422071606-d43ccc771100/go.mod h1:rOxrwdYL7hJDhxFH3uV+nVgLPjWOhJWgM5PRD5YG1jI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=