fix(config): add a bolder warning when missing .env (#43979)

This commit is contained in:
Mrugesh Mohapatra
2021-10-25 09:23:13 +05:30
committed by GitHub
parent fa8b2693ad
commit f5ccaf971b

View File

@ -4,12 +4,16 @@ const envPath = path.resolve(__dirname, '../.env');
const { error } = require('dotenv').config({ path: envPath }); const { error } = require('dotenv').config({ path: envPath });
if (error) { if (error) {
if (process.env.FREECODECAMP_NODE_ENV === 'development') { console.warn(`
console.warn('.env not found, please copy sample.env to .env'); ----------------------------------------------------
} else { Warning: .env file not found.
console.warn(`.env not found. If env vars are not being set another way, ----------------------------------------------------
this could be a problem.`); Please copy sample.env to .env
}
You can ignore this warning if using a different way
to setup this environment.
----------------------------------------------------
`);
} }
const { const {