From 21bb5ea2ed53a8e54aff1eda1248b3fc63beb65e Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 28 Dec 2022 15:34:53 -0500 Subject: [PATCH] fix: delete existing Procfile if the user tried to overwrite it with a non-existing one This behavior follows what is described in the documentation. --- plugins/ps/triggers.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/ps/triggers.go b/plugins/ps/triggers.go index ee3f133c8..a5c7f317e 100644 --- a/plugins/ps/triggers.go +++ b/plugins/ps/triggers.go @@ -80,6 +80,11 @@ func TriggerCorePostExtract(appName string, sourceWorkDir string) error { if appSourceImage == "" { repoProcfilePath := path.Join(sourceWorkDir, procfilePath) if !common.FileExists(repoProcfilePath) { + if procfilePath != "Procfile" && common.FileExists(repoDefaultProcfilePath) { + if err := os.Remove(repoDefaultProcfilePath); err != nil { + return err + } + } return common.TouchFile(fmt.Sprintf("%s.missing", processSpecificProcfile)) }