From f3aa31efbafc224a409c119264b710825cb70b28 Mon Sep 17 00:00:00 2001 From: Yu Fang Date: Wed, 24 Feb 2021 20:04:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E7=AC=AC=E4=B8=89=E6=96=B9ad?= =?UTF-8?q?b=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/models.go | 4 ++++ go.mod | 1 + go.sum | 1 + services/run.go | 2 +- vendor/modules.txt | 2 ++ 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/config/models.go b/config/models.go index f5ea0a8..e1d2442 100644 --- a/config/models.go +++ b/config/models.go @@ -47,6 +47,10 @@ func (cm *ConfigModel) RunAdbCmd(cmd []string) (string, error) { return string(outbytes), err } +func (cm *ConfigModel) KillAdbServer() (string, error) { + return cm.RunAdbCmd([]string{"kill-server"}) +} + func (cm *ConfigModel) StartAdbServer() (string, error) { return cm.RunAdbCmd([]string{"start-server"}) } diff --git a/go.mod b/go.mod index 48f044f..2ccf7f6 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.15 require ( github.com/OpenIoTHub/service-register v0.1.11 github.com/gin-gonic/gin v1.6.3 + github.com/go-bindata/go-bindata v3.1.2+incompatible // indirect github.com/grandcat/zeroconf v1.0.0 github.com/urfave/cli/v2 v2.2.0 gopkg.in/yaml.v2 v2.2.8 diff --git a/go.sum b/go.sum index 0dd6846..20d6deb 100644 --- a/go.sum +++ b/go.sum @@ -12,6 +12,7 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/go-bindata/go-bindata v3.1.2+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= diff --git a/services/run.go b/services/run.go index b2a0b11..61804f2 100644 --- a/services/run.go +++ b/services/run.go @@ -12,7 +12,7 @@ import ( var AndroidAdbDeviceWithOpenIoTHubMap = make(map[string]*config.AndroidAdbDeviceWithOpenIoTHub) func Run(c *cli.Context) (err error) { - out, err := RunAdbCommand([]string{"kill-server"}) + out, err := config.ConfigModelVar.KillAdbServer() log.Println(out) if err != nil { log.Println(err) diff --git a/vendor/modules.txt b/vendor/modules.txt index 0caf829..b5f9928 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -14,6 +14,8 @@ github.com/gin-gonic/gin/binding github.com/gin-gonic/gin/internal/bytesconv github.com/gin-gonic/gin/internal/json github.com/gin-gonic/gin/render +# github.com/go-bindata/go-bindata v3.1.2+incompatible +## explicit # github.com/go-playground/locales v0.13.0 github.com/go-playground/locales github.com/go-playground/locales/currency