optionally use filepath as part of merge key for merge3

This commit is contained in:
Phillip Wittrock
2020-02-03 15:52:38 -08:00
parent 0cfc3b10fc
commit 2d54981bcd
11 changed files with 422 additions and 3 deletions

View File

@@ -25,6 +25,8 @@ func GetMerge3Runner(name string) *Merge3Runner {
"Path to updated package")
c.Flags().StringVar(&r.toDir, "to", "",
"Path to destination package")
c.Flags().BoolVar(&r.path, "path-merge-key", false,
"Use the path as part of the merge key when merging resources")
r.Command = c
return r
@@ -40,6 +42,7 @@ type Merge3Runner struct {
ancestor string
fromDir string
toDir string
path bool
}
func (r *Merge3Runner) runE(c *cobra.Command, args []string) error {
@@ -47,6 +50,7 @@ func (r *Merge3Runner) runE(c *cobra.Command, args []string) error {
OriginalPath: r.ancestor,
UpdatedPath: r.fromDir,
DestPath: r.toDir,
MergeOnPath: r.path,
}.Merge()
if err != nil {
return err