Skip to content

Commit 4688c2a

Browse files
authored
backwards compatible NewManager (#11)
* backwards compatible NewManager * changelog
1 parent aa84714 commit 4688c2a

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
changelog:
2+
- type: NEW_FEATURE
3+
description: Use manager.NewManagerWithSettings to set up an anyvendor manager with a list of directories to skip.
4+
issueLink: https://github.com/solo-io/anyvendor/issues/12

pkg/manager/protodep.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,24 @@ type Manager struct {
2222
depFactories []depFactory
2323
}
2424

25-
func NewManager(ctx context.Context, settings *anyvendor.FactorySettings) (*Manager, error) {
25+
func NewManager(ctx context.Context, cwd string) (*Manager, error) {
26+
if ctx == nil {
27+
ctx = context.Background()
28+
}
29+
goMod, err := NewGoModFactory(&anyvendor.FactorySettings{
30+
Cwd: cwd,
31+
})
32+
if err != nil {
33+
return nil, err
34+
}
35+
return &Manager{
36+
depFactories: []depFactory{
37+
goMod,
38+
},
39+
}, nil
40+
}
41+
42+
func NewManagerWithSettings(ctx context.Context, settings *anyvendor.FactorySettings) (*Manager, error) {
2643
if ctx == nil {
2744
ctx = context.Background()
2845
}

0 commit comments

Comments
 (0)