fix: ignore DOKKU_SCALE file if app.json has formations key

This commit is contained in:
Jose Diaz-Gonzalez
2021-08-01 00:30:31 -04:00
parent 3fe10efd09
commit bc49a2e124

View File

@@ -535,14 +535,17 @@ func injectDokkuScale(appName string, image string) error {
return nil
}
common.LogWarn("Deprecated: Use the 'formation' key in app.json to specify scaling instead of DOKKU_SCALE")
lines, err := common.FileToSlice(dokkuScaleFile)
if err != nil {
return err
}
if appJSON.Formation == nil {
common.LogWarn("Deprecated: Use the 'formation' key in app.json to specify scaling instead of DOKKU_SCALE")
appJSON.Formation = make(map[string]Formation)
} else {
common.LogWarn("Deprecated: DOKKU_SCALE ignored in favor of 'formation' key in app.json")
return nil
}
for _, line := range lines {