From f869c1d937bf4cf2f7e95d52693d2c053dfb66d0 Mon Sep 17 00:00:00 2001 From: Sambhav Kothari Date: Wed, 5 Jan 2022 22:21:53 +0000 Subject: [PATCH] Use appropriate bindings path for detect Signed-off-by: Sambhav Kothari --- buildpack_test.go | 3 ++- detect.go | 5 ++--- tools/tools.go | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/buildpack_test.go b/buildpack_test.go index b357d6e..9c87c7f 100644 --- a/buildpack_test.go +++ b/buildpack_test.go @@ -21,9 +21,10 @@ import ( "testing" "github.com/BurntSushi/toml" - "github.com/buildpacks/libcnb" "github.com/sclevine/spec" + "github.com/buildpacks/libcnb" + . "github.com/onsi/gomega" ) diff --git a/detect.go b/detect.go index e2800b8..39affd9 100644 --- a/detect.go +++ b/detect.go @@ -126,9 +126,8 @@ func Detect(detector Detector, options ...Option) { logger.Debug(PlatformFormatter(ctx.Platform)) } - file = filepath.Join(ctx.Platform.Path, "bindings") - if ctx.Platform.Bindings, err = NewBindingsFromPath(file); err != nil { - config.exitHandler.Error(fmt.Errorf("unable to read platform bindings %s\n%w", file, err)) + if ctx.Platform.Bindings, err = NewBindingsForBuild(ctx.Platform.Path); err != nil { + config.exitHandler.Error(fmt.Errorf("unable to read platform bindings %s\n%w", ctx.Platform.Path, err)) return } logger.Debugf("Platform Bindings: %+v", ctx.Platform.Bindings) diff --git a/tools/tools.go b/tools/tools.go index a83677f..407e2db 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -1,3 +1,4 @@ +//go:build tools // +build tools package tools