refactor: ensure type, drop comment

This commit is contained in:
decentral1se 2021-12-19 22:45:08 +01:00
parent 3d3eefb2fe
commit fa0a63c11d
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 5 additions and 6 deletions

View File

@ -1,7 +1,6 @@
package config
import (
"errors"
"fmt"
"io/ioutil"
"os"
@ -112,17 +111,17 @@ func readAppEnvFile(appFile AppFile, name AppName) (App, error) {
// newApp creates new App object
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"]
apptype, ok := env["TYPE"]
if !ok {
return App{}, errors.New("missing TYPE variable")
appType, exists := env["TYPE"]
if !exists {
return App{}, fmt.Errorf("%s is missing the TYPE env var", name)
}
return App{
Name: name,
Domain: domain,
Type: apptype,
Type: appType,
Env: env,
Server: appFile.Server,
Path: appFile.Path,