forked from toolshed/abra
		
	chore: style lines
This commit is contained in:
		| @ -51,6 +51,7 @@ You may invoke this command in "wizard" mode and be prompted for input: | |||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			logrus.Fatal(err) | 			logrus.Fatal(err) | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		mainAppVersion := imagesTmp[mainApp] | 		mainAppVersion := imagesTmp[mainApp] | ||||||
|  |  | ||||||
| 		tags, err := recipe.Tags() | 		tags, err := recipe.Tags() | ||||||
| @ -79,9 +80,11 @@ will know that things are likely to change. | |||||||
| 				Message: "which version do you want to begin with?", | 				Message: "which version do you want to begin with?", | ||||||
| 				Options: []string{"0.1.0", "1.0.0"}, | 				Options: []string{"0.1.0", "1.0.0"}, | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 			if err := survey.AskOne(edPrompt, &chosenVersion); err != nil { | 			if err := survey.AskOne(edPrompt, &chosenVersion); err != nil { | ||||||
| 				logrus.Fatal(err) | 				logrus.Fatal(err) | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 			nextTag = fmt.Sprintf("%s+%s", chosenVersion, mainAppVersion) | 			nextTag = fmt.Sprintf("%s+%s", chosenVersion, mainAppVersion) | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| @ -97,25 +100,30 @@ will know that things are likely to change. | |||||||
| 			if err != nil { | 			if err != nil { | ||||||
| 				logrus.Fatal(err) | 				logrus.Fatal(err) | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 			var lastGitTag tagcmp.Tag | 			var lastGitTag tagcmp.Tag | ||||||
| 			iter, err := repo.Tags() | 			iter, err := repo.Tags() | ||||||
| 			if err != nil { | 			if err != nil { | ||||||
| 				logrus.Fatal(err) | 				logrus.Fatal(err) | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 			if err := iter.ForEach(func(ref *plumbing.Reference) error { | 			if err := iter.ForEach(func(ref *plumbing.Reference) error { | ||||||
| 				obj, err := repo.TagObject(ref.Hash()) | 				obj, err := repo.TagObject(ref.Hash()) | ||||||
| 				if err != nil { | 				if err != nil { | ||||||
| 					return err | 					return err | ||||||
| 				} | 				} | ||||||
|  |  | ||||||
| 				tagcmpTag, err := tagcmp.Parse(obj.Name) | 				tagcmpTag, err := tagcmp.Parse(obj.Name) | ||||||
| 				if err != nil { | 				if err != nil { | ||||||
| 					return err | 					return err | ||||||
| 				} | 				} | ||||||
|  |  | ||||||
| 				if (lastGitTag == tagcmp.Tag{}) { | 				if (lastGitTag == tagcmp.Tag{}) { | ||||||
| 					lastGitTag = tagcmpTag | 					lastGitTag = tagcmpTag | ||||||
| 				} else if tagcmpTag.IsGreaterThan(lastGitTag) { | 				} else if tagcmpTag.IsGreaterThan(lastGitTag) { | ||||||
| 					lastGitTag = tagcmpTag | 					lastGitTag = tagcmpTag | ||||||
| 				} | 				} | ||||||
|  |  | ||||||
| 				return nil | 				return nil | ||||||
| 			}); err != nil { | 			}); err != nil { | ||||||
| 				logrus.Fatal(err) | 				logrus.Fatal(err) | ||||||
| @ -126,7 +134,7 @@ will know that things are likely to change. | |||||||
| 			if bumpType != 0 { | 			if bumpType != 0 { | ||||||
| 				// a bitwise check if the number is a power of 2 | 				// a bitwise check if the number is a power of 2 | ||||||
| 				if (bumpType & (bumpType - 1)) != 0 { | 				if (bumpType & (bumpType - 1)) != 0 { | ||||||
| 					logrus.Fatal("you can only use one of: --major, --minor, --patch.") | 					logrus.Fatal("you can only use one version flag: --major, --minor or --patch") | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
| @ -137,12 +145,14 @@ will know that things are likely to change. | |||||||
| 					if err != nil { | 					if err != nil { | ||||||
| 						logrus.Fatal(err) | 						logrus.Fatal(err) | ||||||
| 					} | 					} | ||||||
|  |  | ||||||
| 					newTag.Patch = strconv.Itoa(now + 1) | 					newTag.Patch = strconv.Itoa(now + 1) | ||||||
| 				} else if internal.Minor { | 				} else if internal.Minor { | ||||||
| 					now, err := strconv.Atoi(newTag.Minor) | 					now, err := strconv.Atoi(newTag.Minor) | ||||||
| 					if err != nil { | 					if err != nil { | ||||||
| 						logrus.Fatal(err) | 						logrus.Fatal(err) | ||||||
| 					} | 					} | ||||||
|  |  | ||||||
| 					newTag.Patch = "0" | 					newTag.Patch = "0" | ||||||
| 					newTag.Minor = strconv.Itoa(now + 1) | 					newTag.Minor = strconv.Itoa(now + 1) | ||||||
| 				} else if internal.Major { | 				} else if internal.Major { | ||||||
| @ -150,6 +160,7 @@ will know that things are likely to change. | |||||||
| 					if err != nil { | 					if err != nil { | ||||||
| 						logrus.Fatal(err) | 						logrus.Fatal(err) | ||||||
| 					} | 					} | ||||||
|  |  | ||||||
| 					newTag.Patch = "0" | 					newTag.Patch = "0" | ||||||
| 					newTag.Minor = "0" | 					newTag.Minor = "0" | ||||||
| 					newTag.Major = strconv.Itoa(now + 1) | 					newTag.Major = strconv.Itoa(now + 1) | ||||||
|  | |||||||
| @ -142,7 +142,6 @@ func UpdateLabel(pattern, serviceName, label, recipeName string) error { | |||||||
| 			logrus.Warn("no existing label found, cannot continue...") | 			logrus.Warn("no existing label found, cannot continue...") | ||||||
| 			logrus.Fatalf("add \"%s\" manually, automagic insertion not supported yet", label) | 			logrus.Fatalf("add \"%s\" manually, automagic insertion not supported yet", label) | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	return nil | 	return nil | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user