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.
This commit is contained in:
Jose Diaz-Gonzalez
2022-12-28 15:34:53 -05:00
parent d9af6516bb
commit 21bb5ea2ed

View File

@@ -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))
}