mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-22 07:11:01 +00:00
Merge 3e5e661646 into 7e7aadc207
This commit is contained in:
commit
c64d0d7151
1 changed files with 19 additions and 1 deletions
|
|
@ -579,10 +579,28 @@ func loadUserConfig(configDir string, base *UserConfig) (*UserConfig, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if err := yaml.Unmarshal(content, base); err != nil {
|
||||
tempConfig := &UserConfig{}
|
||||
if err := yaml.Unmarshal(content, tempConfig); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Merge bulk commands instead of replacing them
|
||||
if len(tempConfig.BulkCommands.Services) > 0 {
|
||||
base.BulkCommands.Services = append(base.BulkCommands.Services, tempConfig.BulkCommands.Services...)
|
||||
}
|
||||
if len(tempConfig.BulkCommands.Containers) > 0 {
|
||||
base.BulkCommands.Containers = append(base.BulkCommands.Containers, tempConfig.BulkCommands.Containers...)
|
||||
}
|
||||
if len(tempConfig.BulkCommands.Images) > 0 {
|
||||
base.BulkCommands.Images = append(base.BulkCommands.Images, tempConfig.BulkCommands.Images...)
|
||||
}
|
||||
if len(tempConfig.BulkCommands.Volumes) > 0 {
|
||||
base.BulkCommands.Volumes = append(base.BulkCommands.Volumes, tempConfig.BulkCommands.Volumes...)
|
||||
}
|
||||
if len(tempConfig.BulkCommands.Networks) > 0 {
|
||||
base.BulkCommands.Networks = append(base.BulkCommands.Networks, tempConfig.BulkCommands.Networks...)
|
||||
}
|
||||
|
||||
return base, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue