diff --git a/build.go b/build.go new file mode 100644 index 0000000..09d4ce9 --- /dev/null +++ b/build.go @@ -0,0 +1,18 @@ +package enable + +import ( + "os" + + "github.com/paketo-buildpacks/packit/v2" + "github.com/paketo-buildpacks/packit/v2/scribe" +) + +func Build(logger scribe.Emitter) packit.BuildFunc { + return func(context packit.BuildContext) (packit.BuildResult, error) { + if os.Getenv("BP_INCLUDE_NODEJS_RUNTIME") == "true" { + logger.Title("%s %s", context.BuildpackInfo.ID, context.BuildpackInfo.Version) + logger.Process("NodeJS was configured for execution at runtime") + } + return packit.BuildResult{}, nil + } +} diff --git a/run/main.go b/run/main.go index 31aa98d..ee812aa 100644 --- a/run/main.go +++ b/run/main.go @@ -10,5 +10,5 @@ import ( func main() { logger := scribe.NewEmitter(os.Stdout).WithLevel(os.Getenv("BP_LOG_LEVEL")) - packit.Detect(enable.Detect(logger)) + packit.Run(enable.Detect(logger), enable.Build(logger)) }