fix: do not error when default Procfile path does not exist when using a custom procfile-path

Closes #4870
This commit is contained in:
Jose Diaz-Gonzalez authored and GitHub committed 2021-10-16 16:34:34 -04:00
1 parent afea3b54a8
commit 43631e8847
1 file changed
+5 -2
+5 -2
View File
@@ -40,8 +40,11 @@ func TriggerCorePostExtract(appName string, sourceWorkDir string) error {
return nil return nil
} }
if err := os.Remove(path.Join(sourceWorkDir, "Procfile")); err != nil { defaultProcfilePath := path.Join(sourceWorkDir, "Procfile")
return fmt.Errorf("Unable to remove existing Procfile: %v", err.Error()) 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) fullProcfilePath := path.Join(sourceWorkDir, procfilePath)