Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cobra.Command{ Use: "version-bump", Short: "Set version in Helm Chart", Aliases: []string{"vb"}, Args: cobra.NoArgs, Run: func(c *cobra.Command, args []string) { data, _ := os.ReadFile(FlagFile) s := replace(string(data), "version", FlagVersion) os.WriteFile(FlagFile, []byte(s), 0644) if CmdFlagNoCommit { return } r, err := git.PlainOpen(".") if err != nil { panic(err) } w, err := r.Worktree() if err != nil { panic(err) } _, err = w.Add(FlagFile) if err != nil { panic(err) } scope := "" if FlagScope != "" { scope = "(" + FlagScope + ")" } commit, _ := w.Commit("VERSION"+scope+": "+FlagVersion, &git.CommitOptions{}) _, err = r.CommitObject(commit) if err != nil { panic(err) } if CmdFlagTag { _, err := r.CreateTag( FlagVersion, commit, &git.CreateTagOptions{ Message: "VERSION" + scope + ": " + FlagVersion, }, ) if err != nil { panic(err) } } }, }
View Source
var CmdFlagNoCommit bool
View Source
var CmdFlagTag bool
View Source
var FlagFile string
View Source
var FlagScope string
View Source
var FlagVersion string
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.