From e01730857c0250357376ad98d015d5dfd788d69c Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 28 Dec 2022 15:36:34 -0500 Subject: [PATCH] fix: overwrite the in-repo Procfile with the desired Procfile Without this change, herokuish and pack builds would not run the correct command as the Procfile could still be the old Procfile. --- plugins/ps/triggers.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/ps/triggers.go b/plugins/ps/triggers.go index a5c7f317e..c6ef96a8e 100644 --- a/plugins/ps/triggers.go +++ b/plugins/ps/triggers.go @@ -77,6 +77,7 @@ func TriggerCorePostExtract(appName string, sourceWorkDir string) error { b, _ := common.PlugnTriggerOutput("git-get-property", []string{appName, "source-image"}...) appSourceImage := strings.TrimSpace(string(b[:])) + repoDefaultProcfilePath := path.Join(sourceWorkDir, "Procfile") if appSourceImage == "" { repoProcfilePath := path.Join(sourceWorkDir, procfilePath) if !common.FileExists(repoProcfilePath) { @@ -91,6 +92,12 @@ func TriggerCorePostExtract(appName string, sourceWorkDir string) error { if err := copy.Copy(repoProcfilePath, processSpecificProcfile); err != nil { return fmt.Errorf("Unable to extract Procfile: %v", err.Error()) } + + if procfilePath != "Procfile" { + if err := copy.Copy(repoProcfilePath, repoDefaultProcfilePath); err != nil { + return fmt.Errorf("Unable to move Procfile into place: %v", err.Error()) + } + } } else { if err := common.CopyFromImage(appName, appSourceImage, procfilePath, processSpecificProcfile); err != nil { return common.TouchFile(fmt.Sprintf("%s.missing", processSpecificProcfile))