@@ -12,7 +12,11 @@ import (
1212 "github.com/fatih/color"
1313)
1414
15- type Profile map [string ]map [string ]any
15+ type Properties map [string ]map [string ]string
16+
17+ type Profile struct {
18+ Properties Properties `json:"properties"`
19+ }
1620
1721// TODO: return a new profile that only includes properties that were actually changed based on the merge and exclude settings.
1822func applyProfile (profilePath string , mergeBehavior MergeBehavior , exclude ExcludePatterns , dryRun bool ) error {
@@ -32,7 +36,7 @@ func applyProfile(profilePath string, mergeBehavior MergeBehavior, exclude Exclu
3236
3337 // Get all the default values
3438 defaultValueQueries := make (map [string ][]string )
35- for channel , properties := range profile {
39+ for channel , properties := range profile . Properties {
3640 defaultValueQueries [channel ] = []string {}
3741 for property , _ := range properties {
3842 defaultValueQueries [channel ] = append (defaultValueQueries [channel ], property )
@@ -49,7 +53,7 @@ func applyProfile(profilePath string, mergeBehavior MergeBehavior, exclude Exclu
4953 return fmt .Errorf ("could not get current property values: %v" , err )
5054 }
5155
52- for channel , properties := range profile {
56+ for channel , properties := range profile . Properties {
5357 // Keys starting with X- are not channels
5458 if strings .HasPrefix (channel , "X-" ) {
5559 continue
@@ -115,7 +119,7 @@ func revertProfile(profilePath string, exclude ExcludePatterns, dryRun bool) err
115119 blue := color .New (color .FgHiBlue ).SprintFunc ()
116120 yellow := color .New (color .FgHiYellow ).SprintFunc ()
117121
118- for channel , properties := range profile {
122+ for channel , properties := range profile . Properties {
119123 // Keys starting with X- are not channels
120124 if strings .HasPrefix (channel , "X-" ) {
121125 continue
0 commit comments