forked from toolshed/abra
refactor: use app getting instead of boilerplate
This commit is contained in:
20
pkg/app/app.go
Normal file
20
pkg/app/app.go
Normal file
@ -0,0 +1,20 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"coopcloud.tech/abra/pkg/config"
|
||||
)
|
||||
|
||||
// Get retrieves an app
|
||||
func Get(appName string) (config.App, error) {
|
||||
files, err := config.LoadAppFiles("")
|
||||
if err != nil {
|
||||
return config.App{}, err
|
||||
}
|
||||
|
||||
app, err := config.GetApp(files, appName)
|
||||
if err != nil {
|
||||
return config.App{}, err
|
||||
}
|
||||
|
||||
return app, nil
|
||||
}
|
Reference in New Issue
Block a user