fix: handle case where there is no app.json
Somehow, an empty file may get copied over...
This commit is contained in:
1 parent
aaf8bc811a
commit
4ab9632526
1 file changed
+4
@@ -85,6 +85,10 @@ func getPhaseScript(appName string, image string, phase string) (string, error)
|
|||||||
return "", fmt.Errorf("Cannot read app.json file: %v", err)
|
return "", fmt.Errorf("Cannot read app.json file: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if strings.TrimSpace(string(b)) == "" {
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
|
|
||||||
var appJson AppJson
|
var appJson AppJson
|
||||||
if err = json.Unmarshal(b, &appJson); err != nil {
|
if err = json.Unmarshal(b, &appJson); err != nil {
|
||||||
return "", fmt.Errorf("Cannot parse app.json: %v", err)
|
return "", fmt.Errorf("Cannot parse app.json: %v", err)
|
||||||
|
|||||||
Reference in new issue
Block a user