fix: tighten up ensure-env and env.js (#39694)
This commit is contained in:
committed by
GitHub
parent
3d7af80047
commit
61ba415717
@ -45,6 +45,12 @@ if (FREECODECAMP_NODE_ENV === 'production') {
|
||||
throw Error(`Env. variable ${key} is missing, build cannot continue`);
|
||||
}
|
||||
}
|
||||
|
||||
if (env['environment'] !== 'production')
|
||||
throw Error("Production environment should be 'production' ");
|
||||
|
||||
if (env['showUpcomingChanges'])
|
||||
throw Error("SHOW_UPCOMING_CHANGES should never be 'true' in production");
|
||||
}
|
||||
|
||||
fs.writeFileSync(`${clientPath}/config/env.json`, JSON.stringify(env));
|
||||
|
Reference in New Issue
Block a user