fix: more fixed for dry mode, this time tested :)

Follows 299276c383.
This commit is contained in:
decentral1se 2021-12-31 13:36:46 +01:00
parent 299276c383
commit ce96269be0
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
3 changed files with 13 additions and 5 deletions

View File

@ -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")
}

View File

@ -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")
}
}

View File

@ -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
}