fix: add env var to build language files
This commit is contained in:
@ -5,7 +5,6 @@ const debug = require('debug');
|
||||
const envPath = path.resolve(__dirname, '../../.env');
|
||||
require('dotenv').config({ path: envPath });
|
||||
|
||||
const env = require('../../config/env');
|
||||
const { createRedirects } = require('./createRedirects');
|
||||
|
||||
const log = debug('fcc:tools:ensure-env');
|
||||
@ -13,12 +12,23 @@ const {
|
||||
HOME_LOCATION: home,
|
||||
API_LOCATION: api,
|
||||
FORUM_LOCATION: forum,
|
||||
FORUM_PROXY_LOCATION: forumProxy
|
||||
FORUM_PROXY_LOCATION: forumProxy,
|
||||
LOCALE: locale
|
||||
} = process.env;
|
||||
|
||||
const locations = {
|
||||
homeLocation: home,
|
||||
apiLocation: api,
|
||||
forumLocation: forum,
|
||||
forumProxyLocation: forumProxy
|
||||
};
|
||||
|
||||
|
||||
const apiPath = path.resolve(__dirname, '../../api-server');
|
||||
const clientPath = path.resolve(__dirname, '../../client');
|
||||
const clientStaticPath = path.resolve(clientPath, 'static');
|
||||
const globalConfigPath = path.resolve(__dirname, '../../config');
|
||||
const env = Object.assign(locations, {locale});
|
||||
|
||||
const redirects = createRedirects({ api, home, forum, forumProxy });
|
||||
|
||||
@ -30,15 +40,6 @@ fs.writeFile(`${clientStaticPath}/_redirects`, redirects, function(err) {
|
||||
log('_redirects written');
|
||||
});
|
||||
|
||||
fs.access(`${apiPath}/server/rev-manifest.json`, function(err) {
|
||||
if (err) {
|
||||
log('creating manifest');
|
||||
return fs.writeFileSync(`${apiPath}/server/rev-manifest.json`, '{}');
|
||||
}
|
||||
log('rev-manifest present');
|
||||
return null;
|
||||
});
|
||||
|
||||
fs.access(`${apiPath}/server/resources/pathMigration.json`, err => {
|
||||
if (err) {
|
||||
log('creating pathMigration');
|
||||
@ -52,3 +53,4 @@ fs.access(`${apiPath}/server/resources/pathMigration.json`, err => {
|
||||
});
|
||||
|
||||
fs.writeFileSync(`${clientPath}/config/env.json`, JSON.stringify(env));
|
||||
fs.writeFileSync(`${globalConfigPath}/env.json`, JSON.stringify(env));
|
||||
|
742
tools/scripts/seed/package-lock.json
generated
742
tools/scripts/seed/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user