Skip to content

Commit

Permalink
Updates config to use testenv only if it exists (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
vijetmahabaleshwar-okta authored Sep 11, 2019
1 parent 7db8766 commit 7c544e9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/app/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ const fs = require('fs');
const path = require('path');

// Read environment variables from "testenv". Override environment vars if they are already set.
const envConfig = dotenv.parse(fs.readFileSync(path.resolve(__dirname, '../..', 'testenv')));
Object.keys(envConfig).forEach((k) => {
process.env[k] = envConfig[k];
});
const TESTENV = path.resolve(__dirname, '../..', 'testenv');

if (fs.existsSync(TESTENV)) {
const envConfig = dotenv.parse(fs.readFileSync(TESTENV));
Object.keys(envConfig).forEach((k) => {
process.env[k] = envConfig[k];
});
}

var webpack = require('webpack');
const ROOT_DIR = path.resolve(__dirname, '..', '..');
Expand Down

0 comments on commit 7c544e9

Please sign in to comment.