forked from toolshed/abra
refactor(recipe): move GetComposeFiles to new struct
This commit is contained in:
@ -161,7 +161,8 @@ func (a App) Filters(appendServiceNames, exactMatch bool, services ...string) (f
|
||||
return filters, nil
|
||||
}
|
||||
|
||||
composeFiles, err := recipe.GetComposeFiles(a.Recipe, a.Env)
|
||||
r := recipe.Get2(a.Recipe)
|
||||
composeFiles, err := r.GetComposeFiles(a.Env)
|
||||
if err != nil {
|
||||
return filters, err
|
||||
}
|
||||
@ -317,7 +318,8 @@ func GetAppServiceNames(appName string) ([]string, error) {
|
||||
return serviceNames, err
|
||||
}
|
||||
|
||||
composeFiles, err := recipe.GetComposeFiles(app.Recipe, app.Env)
|
||||
r := recipe.Get2(app.Recipe)
|
||||
composeFiles, err := r.GetComposeFiles(app.Env)
|
||||
if err != nil {
|
||||
return serviceNames, err
|
||||
}
|
||||
|
@ -85,7 +85,8 @@ func TestGetComposeFiles(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
composeFiles, err := recipe.GetComposeFiles(r.Name, test.appEnv)
|
||||
r2 := recipe.Get2(r.Name)
|
||||
composeFiles, err := r2.GetComposeFiles(test.appEnv)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -106,7 +107,8 @@ func TestGetComposeFilesError(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
_, err := recipe.GetComposeFiles(r.Name, test.appEnv)
|
||||
r2 := recipe.Get2(r.Name)
|
||||
_, err := r2.GetComposeFiles(test.appEnv)
|
||||
if err == nil {
|
||||
t.Fatalf("should have failed: %v", test.appEnv)
|
||||
}
|
||||
|
Reference in New Issue
Block a user