From 299276c383a1cd4c242db86132d555d934ea131f Mon Sep 17 00:00:00 2001 From: cellarspoon Date: Fri, 31 Dec 2021 13:17:50 +0100 Subject: [PATCH] fix: handle dry run output result correctly --- cli/catalogue/catalogue.go | 6 +++--- cli/recipe/release.go | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cli/catalogue/catalogue.go b/cli/catalogue/catalogue.go index c443ee72..8c04a895 100644 --- a/cli/catalogue/catalogue.go +++ b/cli/catalogue/catalogue.go @@ -235,11 +235,11 @@ keys configured on your account. logrus.Fatal(err) } - if internal.Dry { - logrus.Info("dry run: no changes published") - } else { + if !internal.Dry { url := fmt.Sprintf("%s/recipes/commits/%s", config.REPOS_BASE_URL, head.Hash()) logrus.Infof("new changes published: %s", url) + } else { + logrus.Info("dry run: no changes published") } return nil diff --git a/cli/recipe/release.go b/cli/recipe/release.go index 72cacbc0..08be09c9 100644 --- a/cli/recipe/release.go +++ b/cli/recipe/release.go @@ -292,10 +292,12 @@ func pushRelease(recipe recipe.Recipe, tagString string) error { if err := recipe.Push(internal.Dry); err != nil { return err } - } - url := fmt.Sprintf("%s/%s/tags/%s", config.REPOS_BASE_URL, recipe.Name, tagString) - logrus.Infof("new release published: %s", url) + if !internal.Dry { + url := fmt.Sprintf("%s/%s/tags/%s", config.REPOS_BASE_URL, recipe.Name, tagString) + logrus.Infof("new release published: %s", url) + } + } return nil }