diff --git a/procfile/build.go b/procfile/build.go index 7460bc0..c561125 100644 --- a/procfile/build.go +++ b/procfile/build.go @@ -47,7 +47,7 @@ func (b Build) Build(context libcnb.BuildContext) (libcnb.BuildResult, error) { for k, v := range e.Metadata { process := libcnb.Process{Type: k} - if (context.StackID == libpak.BionicTinyStackID) || (context.StackID == libpak.JammyTinyStackID) { + if (context.StackID == libpak.BionicTinyStackID) || (context.StackID == libpak.JammyTinyStackID) || sherpa.ResolveBool("BP_DIRECT_PROCESS") { s, err := shellwords.Parse(v.(string)) if err != nil { return libcnb.BuildResult{}, fmt.Errorf("unable to parse %s\n%w", s, err) @@ -58,7 +58,7 @@ func (b Build) Build(context libcnb.BuildContext) (libcnb.BuildResult, error) { process.Direct = true } else { process.Command = v.(string) - process.Direct = sherpa.ResolveBool("BP_DIRECT_PROCESS") + process.Direct = false } result.Processes = append(result.Processes, process) diff --git a/procfile/build_test.go b/procfile/build_test.go index 8c5c43b..ac55766 100644 --- a/procfile/build_test.go +++ b/procfile/build_test.go @@ -78,7 +78,7 @@ func testBuild(t *testing.T, context spec.G, it spec.S) { { Name: "procfile", Metadata: map[string]interface{}{ - "test-type": "test-command", + "test-type": "test-command arg", }, }, }, @@ -87,9 +87,10 @@ func testBuild(t *testing.T, context spec.G, it spec.S) { result := libcnb.NewBuildResult() result.Processes = append(result.Processes, libcnb.Process{ - Type: "test-type", - Command: "test-command", - Direct: true, + Type: "test-type", + Command: "test-command", + Arguments: []string{"arg"}, + Direct: true, }, )