forked from coop-cloud/abra
refactor: ensure type, drop comment
This commit is contained in:
parent
3d3eefb2fe
commit
fa0a63c11d
|
@ -1,7 +1,6 @@
|
||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
@ -112,17 +111,17 @@ func readAppEnvFile(appFile AppFile, name AppName) (App, error) {
|
||||||
|
|
||||||
// newApp creates new App object
|
// newApp creates new App object
|
||||||
func newApp(env AppEnv, name string, appFile AppFile) (App, error) {
|
func newApp(env AppEnv, name string, appFile AppFile) (App, error) {
|
||||||
// Checking for type as it is required - apps wont work without it
|
|
||||||
domain := env["DOMAIN"]
|
domain := env["DOMAIN"]
|
||||||
apptype, ok := env["TYPE"]
|
|
||||||
if !ok {
|
appType, exists := env["TYPE"]
|
||||||
return App{}, errors.New("missing TYPE variable")
|
if !exists {
|
||||||
|
return App{}, fmt.Errorf("%s is missing the TYPE env var", name)
|
||||||
}
|
}
|
||||||
|
|
||||||
return App{
|
return App{
|
||||||
Name: name,
|
Name: name,
|
||||||
Domain: domain,
|
Domain: domain,
|
||||||
Type: apptype,
|
Type: appType,
|
||||||
Env: env,
|
Env: env,
|
||||||
Server: appFile.Server,
|
Server: appFile.Server,
|
||||||
Path: appFile.Path,
|
Path: appFile.Path,
|
||||||
|
|
Loading…
Reference in New Issue