mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 09:24:23 +00:00
Simplify use of the Merginator.
This commit is contained in:
@@ -63,14 +63,14 @@ func (gr *gitRunner) DeleteWorktreeDir() error {
|
||||
|
||||
func (gr *gitRunner) WorktreePath() (string, error) {
|
||||
if gr.worktreePath == "" {
|
||||
return "", fmt.Errorf("Empty worktree path")
|
||||
return "", fmt.Errorf("empty worktree path")
|
||||
}
|
||||
return gr.worktreePath, nil
|
||||
}
|
||||
|
||||
func (gr *gitRunner) OriginalGitPath() (string, error) {
|
||||
if gr.originalGitPath == "" {
|
||||
return "", fmt.Errorf("Empty git path")
|
||||
return "", fmt.Errorf("empty git path")
|
||||
}
|
||||
return gr.originalGitPath, nil
|
||||
}
|
||||
@@ -107,7 +107,7 @@ func (gr *gitRunner) CheckRemoteExistence(remote string) error {
|
||||
regString := fmt.Sprintf("(?m)^\\s*%s\\s*$", remote)
|
||||
reg := regexp.MustCompile(regString)
|
||||
if !reg.MatchString(string(stdoutStderr)) {
|
||||
return fmt.Errorf("Cannot find remote named %s", remote)
|
||||
return fmt.Errorf("cannot find remote named %s", remote)
|
||||
}
|
||||
logDebug("Remote %s exists", remote)
|
||||
return nil
|
||||
|
||||
@@ -29,7 +29,7 @@ func (v *moduleVersion) Bump(t string) error {
|
||||
} else if t == "patch" {
|
||||
v.patch++
|
||||
} else {
|
||||
return fmt.Errorf("Invalid version type: %s", t)
|
||||
return fmt.Errorf("invalid version type: %s", t)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -37,14 +37,14 @@ func (v *moduleVersion) Bump(t string) error {
|
||||
func newModuleVersionFromString(vs string) (moduleVersion, error) {
|
||||
v := moduleVersion{}
|
||||
if len(vs) < 1 {
|
||||
return v, fmt.Errorf("Invalid version string %s", vs)
|
||||
return v, fmt.Errorf("invalid version string %s", vs)
|
||||
}
|
||||
if vs[0] == 'v' {
|
||||
vs = vs[1:]
|
||||
}
|
||||
versions := strings.Split(vs, ".")
|
||||
if len(versions) != 3 {
|
||||
return v, fmt.Errorf("Invalid version string %s", vs)
|
||||
return v, fmt.Errorf("invalid version string %s", vs)
|
||||
}
|
||||
major, err := strconv.Atoi(versions[0])
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user