diff --git a/cli/catalogue/catalogue.go b/cli/catalogue/catalogue.go index 8c04a895..ec7ec440 100644 --- a/cli/catalogue/catalogue.go +++ b/cli/catalogue/catalogue.go @@ -202,7 +202,9 @@ keys configured on your account. } if isClean { - logrus.Fatalf("no changes discovered in %s, nothing to publish?", cataloguePath) + if !internal.Dry { + logrus.Fatalf("no changes discovered in %s, nothing to publish?", cataloguePath) + } } msg := "chore: publish new catalogue release changes" @@ -235,10 +237,12 @@ keys configured on your account. logrus.Fatal(err) } - if !internal.Dry { + if !internal.Dry && internal.Publish { url := fmt.Sprintf("%s/recipes/commits/%s", config.REPOS_BASE_URL, head.Hash()) logrus.Infof("new changes published: %s", url) - } else { + } + + if internal.Dry { logrus.Info("dry run: no changes published") } diff --git a/cli/recipe/release.go b/cli/recipe/release.go index 08be09c9..a72a34ea 100644 --- a/cli/recipe/release.go +++ b/cli/recipe/release.go @@ -231,7 +231,9 @@ func commitRelease(recipe recipe.Recipe, tag string) error { } if isClean { - return fmt.Errorf("no changes discovered in %s, nothing to publish?", recipe.Dir()) + if !internal.Dry { + return fmt.Errorf("no changes discovered in %s, nothing to publish?", recipe.Dir()) + } } if internal.Publish { @@ -296,6 +298,8 @@ func pushRelease(recipe recipe.Recipe, tagString string) error { if !internal.Dry { url := fmt.Sprintf("%s/%s/tags/%s", config.REPOS_BASE_URL, recipe.Name, tagString) logrus.Infof("new release published: %s", url) + } else { + logrus.Info("dry run: no changes published") } } diff --git a/pkg/git/remote.go b/pkg/git/remote.go index 81659816..0d3c995b 100644 --- a/pkg/git/remote.go +++ b/pkg/git/remote.go @@ -11,7 +11,7 @@ import ( // CreateRemote creates a new git remote in a repository func CreateRemote(repo *git.Repository, name, url string, dryRun bool) error { if dryRun { - logrus.Infof("dry run: remote %s (%s) not created", name, url) + logrus.Debugf("dry run: remote %s (%s) not created", name, url) return nil }