From b46e298b4d8d109bf606137c0c23fcb7750491b3 Mon Sep 17 00:00:00 2001 From: Ilya Dmitrichenko Date: Wed, 27 Sep 2023 11:12:45 +0100 Subject: [PATCH] Print artifact source and revision only when available Signed-off-by: Ilya Dmitrichenko --- cmd/flux/pull_artifact.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/flux/pull_artifact.go b/cmd/flux/pull_artifact.go index d61f6dcb..114368bd 100644 --- a/cmd/flux/pull_artifact.go +++ b/cmd/flux/pull_artifact.go @@ -111,8 +111,12 @@ func pullArtifactCmdRun(cmd *cobra.Command, args []string) error { return err } - logger.Successf("source %s", meta.Source) - logger.Successf("revision %s", meta.Revision) + if meta.Source != "" { + logger.Successf("source %s", meta.Source) + } + if meta.Revision != "" { + logger.Successf("revision %s", meta.Revision) + } logger.Successf("digest %s", meta.Digest) logger.Successf("artifact content extracted to %s", pullArtifactArgs.output)