refactor: ensure type, drop comment
This commit is contained in:
parent
3d3eefb2fe
commit
fa0a63c11d
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user