before merging in essential fixes.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/goccy/go-yaml"
|
||||
"github.com/spf13/cobra"
|
||||
"os"
|
||||
)
|
||||
|
||||
func mergeMap(yaml1 yaml.MapSlice, yaml2 yaml.MapSlice) yaml.MapSlice {
|
||||
res := yaml1
|
||||
|
||||
//for key, item := range yaml2 {
|
||||
// switch {
|
||||
// case res.ToMap()[key] != nil && type
|
||||
//
|
||||
// }
|
||||
//}
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
func merge(cmd *cobra.Command, args []string) error {
|
||||
res := make(yaml.MapSlice, 0)
|
||||
for _, arg := range args {
|
||||
config := parse(read(arg))
|
||||
res = mergeMap(res, config)
|
||||
}
|
||||
encode(os.Stdout, res)
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user