forked from toolshed/abra
@ -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),
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user