Skip to content

Commit f293243

Browse files
committed
fix(pull): do not error on partial pull failures
1 parent 1f5d359 commit f293243

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

cmd/mdefaults/main.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,14 @@ func run() int {
6868
fmt.Println("Current Configuration:")
6969
printConfigs(configs)
7070
fmt.Println("macOS Configuration:")
71-
macOSConfigs, err := pullop.Pull(configs)
72-
if err != nil {
73-
code := apperrors.GetErrorCode(err)
74-
printer.PrintError(fmt.Sprintf("[ERROR-%04d] Failed to pull configurations: %v", code, err))
75-
return 1
76-
}
71+
macOSConfigs, pullErr := pullop.Pull(configs)
72+
// Print any configs we were able to pull
7773
printConfigs(macOSConfigs)
74+
// Report if any pulls failed, but continue
75+
if pullErr != nil {
76+
code := apperrors.GetErrorCode(pullErr)
77+
printer.PrintError(fmt.Sprintf("[ERROR-%04d] Some configurations failed to pull: %v", code, pullErr))
78+
}
7879

7980
if !yesFlag {
8081
color.Yellow("Warning: mdefaults will override your configuration file (~/.mdefaults). Proceed with caution.")

0 commit comments

Comments
 (0)