Skip to content

Commit

Permalink
add WithPackager setter for remote and local fetchers
Browse files Browse the repository at this point in the history
  • Loading branch information
Frankie Gallina-Jones authored and ForestEckhardt committed Nov 18, 2021
1 parent a2654e3 commit 7b23af5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions local_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ func NewLocalFetcher(buildpackCache BuildpackCache, packager Packager, namer Nam
}
}

func (l LocalFetcher) WithPackager(packager Packager) LocalFetcher {
l.packager = packager
return l
}

func (l LocalFetcher) Get(buildpack LocalBuildpack) (string, error) {
buildpackCacheDir := filepath.Join(l.buildpackCache.Dir(), buildpack.Name)
if buildpack.Offline {
Expand Down
5 changes: 5 additions & 0 deletions remote_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ func NewRemoteFetcher(buildpackCache BuildpackCache, gitReleaseFetcher GitReleas
}
}

func (r RemoteFetcher) WithPackager(packager Packager) RemoteFetcher {
r.packager = packager
return r
}

func (r RemoteFetcher) Get(buildpack RemoteBuildpack) (string, error) {
release, err := r.gitReleaseFetcher.Get(buildpack.Org, buildpack.Repo)
if err != nil {
Expand Down

0 comments on commit 7b23af5

Please sign in to comment.