Skip to content

Commit

Permalink
Merge pull request #6 from ninech/add-build
Browse files Browse the repository at this point in the history
add the builder to the buildpack
  • Loading branch information
gajicdev authored Nov 29, 2023
2 parents b49c4b8 + 12b4df3 commit 82b5c9f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions build.go
Original file line number Diff line number Diff line change
@@ -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
}
}
2 changes: 1 addition & 1 deletion run/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

0 comments on commit 82b5c9f

Please sign in to comment.