diff --git a/src/configProvider.ts b/src/configProvider.ts index 0c72d80..227c1fa 100644 --- a/src/configProvider.ts +++ b/src/configProvider.ts @@ -32,14 +32,17 @@ export default () => { if (!instance) { const envFilePath = getConfig(`MB_ENV_FILE`); - const overrideEnvFilePath = getConfig(`MB_ENV_FILE_OVR`); + let overrideEnvFilePath; + try { + overrideEnvFilePath = getConfig(`MB_ENV_FILE_OVR`); + } catch {} config({ path: path.join(__dirname, `..`, envFilePath), }); // checks to see if the dev-overrides.env file is present in root directory - if (fs.existsSync(path.join(__dirname, `..`, overrideEnvFilePath))) { + if (overrideEnvFilePath && fs.existsSync(path.join(__dirname, `..`, overrideEnvFilePath))) { // override const envConfig = parse(fs.readFileSync(path.join(__dirname, `..`, overrideEnvFilePath)));