3
0

Properly check errors when env files are missing

This commit is contained in:
Denis Arh
2021-06-30 09:51:03 +02:00
parent 64195215b8
commit 5a67ecf74e

View File

@@ -5,6 +5,7 @@ import (
"path"
"sort"
"github.com/cortezaproject/corteza-server/pkg/errors"
"github.com/joho/godotenv"
"github.com/spf13/cobra"
)
@@ -25,7 +26,7 @@ func LoadEnv(pp ...string) error {
if _, err = os.Stat(chk); err == nil {
// make sure only .env files
checked = append(checked, chk)
} else if err != os.ErrNotExist {
} else if !errors.Is(err, os.ErrNotExist) {
return err
}
} else {