Skip to content

Commit

Permalink
fix(device): always take apps input as source of truth
Browse files Browse the repository at this point in the history
Instead of overriding the input given with what our api is giving back,
it is much better to just take what the user is giving us as what needs
to be set.

Signed-off-by: Eric Bode <[email protected]>
  • Loading branch information
StealthyCoder committed Feb 28, 2024
1 parent e80ab46 commit f9f6852
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions subcommands/common_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,16 +226,13 @@ func SetUpdatesConfig(opts *SetUpdatesConfigOptions, reportedTag string, reporte
if len(configuredTag) == 0 && len(reportedTag) > 0 {
configuredTag = reportedTag
}
if len(configuredApps) == 0 && reportedApps != nil {
configuredApps = strings.Join(reportedApps, ",")
}

changed := false
if opts.UpdateApps != "" && configuredApps != opts.UpdateApps {
if strings.TrimSpace(opts.UpdateApps) == "," {
opts.UpdateApps = ""
}
fmt.Printf("Changing apps from: [%s] -> [%s]\n", configuredApps, opts.UpdateApps)
fmt.Printf("Changing apps to [%s]\n", opts.UpdateApps)
sota.Set("pacman.docker_apps", opts.UpdateApps)
sota.Set("pacman.compose_apps", opts.UpdateApps)
changed = true
Expand Down

0 comments on commit f9f6852

Please sign in to comment.