fix: handle case where there is no app.json

Somehow, an empty file may get copied over...
This commit is contained in:
Jose Diaz-Gonzalez
2020-08-31 02:56:50 -04:00
parent aaf8bc811a
commit 4ab9632526

View File

@@ -85,6 +85,10 @@ func getPhaseScript(appName string, image string, phase string) (string, error)
return "", fmt.Errorf("Cannot read app.json file: %v", err)
}
if strings.TrimSpace(string(b)) == "" {
return "", nil
}
var appJson AppJson
if err = json.Unmarshal(b, &appJson); err != nil {
return "", fmt.Errorf("Cannot parse app.json: %v", err)