Skip to content

Commit

Permalink
backwards compatible NewManager (#11)
Browse files Browse the repository at this point in the history
* backwards compatible NewManager
* changelog
  • Loading branch information
ashleywang1 authored Feb 4, 2021
1 parent aa84714 commit 4688c2a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
4 changes: 4 additions & 0 deletions changelog/v0.0.3/new-manager-with-settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changelog:
- type: NEW_FEATURE
description: Use manager.NewManagerWithSettings to set up an anyvendor manager with a list of directories to skip.
issueLink: https://github.com/solo-io/anyvendor/issues/12
19 changes: 18 additions & 1 deletion pkg/manager/protodep.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,24 @@ type Manager struct {
depFactories []depFactory
}

func NewManager(ctx context.Context, settings *anyvendor.FactorySettings) (*Manager, error) {
func NewManager(ctx context.Context, cwd string) (*Manager, error) {
if ctx == nil {
ctx = context.Background()
}
goMod, err := NewGoModFactory(&anyvendor.FactorySettings{
Cwd: cwd,
})
if err != nil {
return nil, err
}
return &Manager{
depFactories: []depFactory{
goMod,
},
}, nil
}

func NewManagerWithSettings(ctx context.Context, settings *anyvendor.FactorySettings) (*Manager, error) {
if ctx == nil {
ctx = context.Background()
}
Expand Down

0 comments on commit 4688c2a

Please sign in to comment.