feat: debug logging

Closes coop-cloud/organising#164.
This commit is contained in:
2021-09-11 00:54:02 +02:00
parent 27d665c3be
commit 9fcdc45851
38 changed files with 305 additions and 95 deletions

View File

@ -8,7 +8,7 @@ import (
"coopcloud.tech/abra/cli/internal"
"coopcloud.tech/abra/pkg/config"
"github.com/go-git/go-git/v5"
"coopcloud.tech/abra/pkg/git"
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
)
@ -28,10 +28,8 @@ var recipeNewCommand = &cli.Command{
}
url := fmt.Sprintf("%s/example.git", config.REPOS_BASE_URL)
_, err := git.PlainClone(directory, false, &git.CloneOptions{URL: url, Tags: git.AllTags})
if err != nil {
logrus.Fatal(err)
return nil
if err := git.Clone(directory, url); err != nil {
return err
}
gitRepo := path.Join(config.APPS_DIR, recipe.Name, ".git")
@ -39,6 +37,7 @@ var recipeNewCommand = &cli.Command{
logrus.Fatal(err)
return nil
}
logrus.Debugf("removed git repo in '%s'", gitRepo)
toParse := []string{
path.Join(config.APPS_DIR, recipe.Name, "README.md"),
@ -71,7 +70,7 @@ var recipeNewCommand = &cli.Command{
}
logrus.Infof(
"New recipe '%s' created in %s, happy hacking!\n",
"new recipe '%s' created in %s, happy hacking!\n",
recipe.Name, path.Join(config.APPS_DIR, recipe.Name),
)