From 26a11533b45f0374d18442b5307caad5c6e5ff74 Mon Sep 17 00:00:00 2001 From: cellarspoon Date: Tue, 28 Dec 2021 02:37:35 +0100 Subject: [PATCH] feat: link directly to new commit --- cli/catalogue/catalogue.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cli/catalogue/catalogue.go b/cli/catalogue/catalogue.go index 3489710e..8e65b5a9 100644 --- a/cli/catalogue/catalogue.go +++ b/cli/catalogue/catalogue.go @@ -193,8 +193,8 @@ keys configured on your account. logrus.Infof("generated new recipe catalogue in %s", config.RECIPES_JSON) + cataloguePath := path.Join(config.ABRA_DIR, "catalogue") if internal.Publish { - cataloguePath := path.Join(config.ABRA_DIR, "catalogue") isClean, err := gitPkg.IsClean(cataloguePath) if err != nil { @@ -225,10 +225,20 @@ keys configured on your account. } } + repo, err := git.PlainOpen(cataloguePath) + if err != nil { + logrus.Fatal(err) + } + + head, err := repo.Head() + if err != nil { + logrus.Fatal(err) + } + if internal.Dry { logrus.Info("dry run: no changes published") } else { - url := fmt.Sprintf("%s/recipes", config.REPOS_BASE_URL) + url := fmt.Sprintf("%s/recipes/%s", config.REPOS_BASE_URL, head.Hash()) logrus.Infof("new changes published: %s", url) }