From 0012c3c7b256df7db834080740d8fc124c9dba22 Mon Sep 17 00:00:00 2001 From: Sebastien Douheret Date: Mon, 22 Oct 2018 23:06:02 +0200 Subject: [PATCH] Display new image url field with sdk list command Change-Id: I26db1f7ebedd502db123e249a69bad30fbc0db99 Signed-off-by: Sebastien Douheret --- .vscode/launch.json | 6 ++++-- cmd-sdks.go | 10 +++++++++- glide.yaml | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 1fc4ed1..b792099 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,6 +1,8 @@ { "version": "0.2.0", - "configurations": [{ + "configurations": [ + + { "name": "xds-cli (version)", "type": "go", "request": "launch", @@ -16,7 +18,7 @@ "showLog": false }, { - "name": "xds-cli (list)", + "name": "xds-cli sdks (list)", "type": "go", "request": "launch", "mode": "debug", diff --git a/cmd-sdks.go b/cmd-sdks.go index 35b053e..0005215 100644 --- a/cmd-sdks.go +++ b/cmd-sdks.go @@ -187,7 +187,8 @@ func _displaySdks(sdks []xaapiv1.SDK, verbose bool, all bool, filter string) { fmt.Fprintln(writer, "Version\t"+s.Version) fmt.Fprintln(writer, "Status\t"+s.Status) fmt.Fprintln(writer, "Path\t"+s.Path) - fmt.Fprintln(writer, "Url\t"+s.URL) + fmt.Fprintln(writer, "Url\t"+formatURL(s.URL)) + fmt.Fprintln(writer, "Image Url\t"+formatURL(s.ImageURL)) } else { if first { @@ -365,3 +366,10 @@ func sdksAbort(ctx *cli.Context) error { Log.Debugf("Result of %s: %v", url, newSdk) return nil } + +func formatURL(u string) string { + if u == "" { + return "-" + } + return u +} diff --git a/glide.yaml b/glide.yaml index dbae3d8..f3f181a 100644 --- a/glide.yaml +++ b/glide.yaml @@ -12,7 +12,7 @@ import: - package: github.com/sebd71/go-socket.io-client version: 46defcb47f - package: gerrit.automotivelinux.org/gerrit/src/xds/xds-agent.git - version: dea62f2f108934a4df26fcaaf4c0369cd881b1ba + version: e9c65d5fcf8d2ec3772ceced4fe1379392b15a4f subpackages: - lib/xaapiv1 - package: gerrit.automotivelinux.org/gerrit/src/xds/xds-common.git -- 2.16.6