From 43631e88478542e5d82c83d3284927ab5a7d7460 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 16 Oct 2021 16:34:34 -0400 Subject: [PATCH] fix: do not error when default Procfile path does not exist when using a custom procfile-path Closes #4870 --- plugins/ps/triggers.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/ps/triggers.go b/plugins/ps/triggers.go index 646c127be..88c590ef0 100644 --- a/plugins/ps/triggers.go +++ b/plugins/ps/triggers.go @@ -40,8 +40,11 @@ func TriggerCorePostExtract(appName string, sourceWorkDir string) error { return nil } - if err := os.Remove(path.Join(sourceWorkDir, "Procfile")); err != nil { - return fmt.Errorf("Unable to remove existing Procfile: %v", err.Error()) + defaultProcfilePath := path.Join(sourceWorkDir, "Procfile") + if common.FileExists(defaultProcfilePath) { + if err := os.Remove(defaultProcfilePath); err != nil { + return fmt.Errorf("Unable to remove existing Procfile: %v", err.Error()) + } } fullProcfilePath := path.Join(sourceWorkDir, procfilePath)