chore: short-circuit procfile command fetching if there is no procfile

This commit is contained in:
Jose Diaz-Gonzalez
2020-11-01 17:42:32 -05:00
parent cae561f7b9
commit a93f504d45

View File

@@ -2,6 +2,7 @@ package ps
import ( import (
"bytes" "bytes"
"errors"
"fmt" "fmt"
"os" "os"
"path/filepath" "path/filepath"
@@ -101,6 +102,10 @@ func generateScalefile(appName string, destination string) error {
} }
func getProcfileCommand(procfilePath string, processType string, port int) (string, error) { func getProcfileCommand(procfilePath string, processType string, port int) (string, error) {
if !common.FileExists(procfilePath) {
return "", errors.New("No procfile found")
}
shellCmd := common.NewShellCmd(strings.Join([]string{ shellCmd := common.NewShellCmd(strings.Join([]string{
"procfile-util", "procfile-util",
"show", "show",