MCPcopy
hub / github.com/runfinch/finch / InstallOptionalDeps

Function InstallOptionalDeps

pkg/dependency/dependency.go:76–90  ·  view source on GitHub ↗

InstallOptionalDeps installs the supplied dependency groups. Since the groups are all optional, InstallOptionalDeps continues to install the remaining groups even if a group fails to be installed. It returns a non-nil error if any of the groups fails to be installed.

(groups []*Group, logger flog.Logger)

Source from the content-addressed store, hash-verified

74// InstallOptionalDeps continues to install the remaining groups even if a group fails to be installed.
75// It returns a non-nil error if any of the groups fails to be installed.
76func InstallOptionalDeps(groups []*Group, logger flog.Logger) error {
77 var errs []error
78
79 for _, group := range groups {
80 err := group.installOptional(logger)
81 if err != nil {
82 errs = append(errs, err)
83 }
84 }
85 if len(errs) > 0 {
86 return fmt.Errorf("failed to install dependencies: %w", errors.Join(errs...))
87 }
88
89 return nil
90}

Callers 3

runMethod · 0.92
runMethod · 0.92
TestInstallOptionalDepsFunction · 0.85

Calls 2

installOptionalMethod · 0.80
ErrorfMethod · 0.65

Tested by 1

TestInstallOptionalDepsFunction · 0.68