refactor(recipe): rename Recipe2 -> Recipe

This commit is contained in:
2024-07-08 13:19:40 +02:00
parent f638b6a16b
commit f14d49cc64
21 changed files with 85 additions and 85 deletions

View File

@ -24,7 +24,7 @@ var recipeFetchCommand = cli.Command{
BashComplete: autocomplete.RecipeNameComplete,
Action: func(c *cli.Context) error {
recipeName := c.Args().First()
r := recipe.Get2(recipeName)
r := recipe.Get(recipeName)
if recipeName != "" {
internal.ValidateRecipe(c)
if err := r.Ensure(false, false); err != nil {
@ -40,7 +40,7 @@ var recipeFetchCommand = cli.Command{
catlBar := formatter.CreateProgressbar(len(catalogue), "fetching latest recipes...")
for recipeName := range catalogue {
r := recipe.Get2(recipeName)
r := recipe.Get(recipeName)
if err := r.Ensure(false, false); err != nil {
log.Error(err)
}

View File

@ -56,7 +56,7 @@ recipe and domain in the sample environment config).
`,
Action: func(c *cli.Context) error {
recipeName := c.Args().First()
r := recipe.Get2(recipeName)
r := recipe.Get(recipeName)
if recipeName == "" {
internal.ShowSubcommandHelpAndError(c, errors.New("no recipe name provided"))

View File

@ -141,7 +141,7 @@ your SSH keys configured on your account.
}
// getImageVersions retrieves image versions for a recipe
func getImageVersions(recipe recipe.Recipe2) (map[string]string, error) {
func getImageVersions(recipe recipe.Recipe) (map[string]string, error) {
services := make(map[string]string)
config, err := recipe.GetComposeConfig(nil)
@ -185,7 +185,7 @@ func getImageVersions(recipe recipe.Recipe2) (map[string]string, error) {
}
// createReleaseFromTag creates a new release based on a supplied recipe version string
func createReleaseFromTag(recipe recipe.Recipe2, tagString, mainAppVersion string) error {
func createReleaseFromTag(recipe recipe.Recipe, tagString, mainAppVersion string) error {
var err error
directory := path.Join(config.RECIPES_DIR, recipe.Name)
@ -249,7 +249,7 @@ func getTagCreateOptions(tag string) (git.CreateTagOptions, error) {
// addReleaseNotes checks if the release/next release note exists and moves the
// file to release/<tag>.
func addReleaseNotes(recipe recipe.Recipe2, tag string) error {
func addReleaseNotes(recipe recipe.Recipe, tag string) error {
repoPath := path.Join(config.RECIPES_DIR, recipe.Name)
tagReleaseNotePath := path.Join(repoPath, "release", tag)
if _, err := os.Stat(tagReleaseNotePath); err == nil {
@ -323,7 +323,7 @@ func addReleaseNotes(recipe recipe.Recipe2, tag string) error {
return nil
}
func commitRelease(recipe recipe.Recipe2, tag string) error {
func commitRelease(recipe recipe.Recipe, tag string) error {
if internal.Dry {
log.Debugf("dry run: no changes committed")
return nil
@ -376,7 +376,7 @@ func tagRelease(tagString string, repo *git.Repository) error {
return nil
}
func pushRelease(recipe recipe.Recipe2, tagString string) error {
func pushRelease(recipe recipe.Recipe, tagString string) error {
if internal.Dry {
log.Info("dry run: no changes published")
return nil
@ -405,7 +405,7 @@ func pushRelease(recipe recipe.Recipe2, tagString string) error {
return nil
}
func createReleaseFromPreviousTag(tagString, mainAppVersion string, recipe recipe.Recipe2, tags []string) error {
func createReleaseFromPreviousTag(tagString, mainAppVersion string, recipe recipe.Recipe, tags []string) error {
directory := path.Join(config.RECIPES_DIR, recipe.Name)
repo, err := git.PlainOpen(directory)
if err != nil {
@ -528,7 +528,7 @@ func cleanUpTag(tag, recipeName string) error {
return nil
}
func getLabelVersion(recipe recipe.Recipe2, prompt bool) (string, error) {
func getLabelVersion(recipe recipe.Recipe, prompt bool) (string, error) {
initTag, err := recipe.GetVersionLabelLocal()
if err != nil {
return "", err