mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-11-18 12:42:15 -05:00
no config only profiles
This commit is contained in:
@@ -153,9 +153,22 @@ func (m *ManagementClient) execute(ctx context.Context, command managementComman
|
||||
if command.Profile == nil {
|
||||
return nil, fmt.Errorf("profile required")
|
||||
}
|
||||
var config *Config
|
||||
if len(command.Config) > 0 {
|
||||
var err error
|
||||
config, err = DecodeConfig(command.Config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if err := SaveCustomProfile(command.Category, *command.Profile); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if config != nil {
|
||||
if err := SaveConfig(m.configPath, config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
m.stopping = true
|
||||
if m.runtime != nil {
|
||||
_ = m.runtime.PrepareShutdown()
|
||||
|
||||
Reference in New Issue
Block a user