forked from toolshed/abra
		
	fix: recipe lint and logrus usage
This commit is contained in:
		| @ -5,6 +5,7 @@ import ( | ||||
| 	"fmt" | ||||
| 	"os" | ||||
| 	"path" | ||||
| 	"path/filepath" | ||||
| 	"sort" | ||||
| 	"strconv" | ||||
| 	"strings" | ||||
| @ -18,6 +19,7 @@ import ( | ||||
| 	"coopcloud.tech/abra/config" | ||||
| 	"coopcloud.tech/tagcmp" | ||||
|  | ||||
| 	loader "coopcloud.tech/abra/client/stack" | ||||
| 	"github.com/AlecAivazis/survey/v2" | ||||
| 	"github.com/docker/distribution/reference" | ||||
| 	"github.com/go-git/go-git/v5" | ||||
| @ -142,7 +144,7 @@ var recipeCreateCommand = &cli.Command{ | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		fmt.Printf( | ||||
| 		logrus.Infof( | ||||
| 			"New recipe '%s' created in %s, happy hacking!\n", | ||||
| 			recipe, path.Join(config.APPS_DIR, recipe), | ||||
| 		) | ||||
| @ -361,17 +363,13 @@ var recipeLintCommand = &cli.Command{ | ||||
| 			internal.ShowSubcommandHelpAndError(c, errors.New("no recipe provided")) | ||||
| 		} | ||||
|  | ||||
| 		appFiles, err := config.LoadAppFiles("") | ||||
| 		pattern := fmt.Sprintf("%s/%s/compose**yml", config.APPS_DIR, recipe) | ||||
| 		composeFiles, err := filepath.Glob(pattern) | ||||
| 		if err != nil { | ||||
| 			logrus.Fatal(err) | ||||
| 		} | ||||
|  | ||||
| 		appEnv, err := config.GetApp(appFiles, recipe) | ||||
| 		if err != nil { | ||||
| 			logrus.Fatal(err) | ||||
| 		} | ||||
|  | ||||
| 		compose, err := config.GetAppComposeConfig(recipe, stack.Deploy{}, appEnv.Env) | ||||
| 		opts := stack.Deploy{Composefiles: composeFiles} | ||||
| 		compose, err := loader.LoadComposefile(opts, make(map[string]string)) | ||||
| 		if err != nil { | ||||
| 			logrus.Fatal(err) | ||||
| 		} | ||||
|  | ||||
		Reference in New Issue
	
	Block a user