diff --git a/README.md b/README.md index 44417596c3e4c2e8b76a0e762c9344ed47c1a363..65b22d3541a9a08b26e4f672d3e581d4eb26acf3 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ It can be called without arguments, in which case it will take its configuration ``` Alternatively it can be passed the `dbManager` object as an argument, which will override the values on config. -The name of the database will be the full dbPath with the NODE_ENV appended. +The name of the database will be the full `dbPath`. ### `addUser` @@ -61,5 +61,5 @@ addUser({ ### `dbExists` -This function checks if any database exists at the configured path for the current NODE_ENV. Returns `true` or `false` +This function checks if any database exists at the configured path. Returns `true` or `false` diff --git a/config/custom-environment-variables.js b/config/custom-environment-variables.js deleted file mode 100644 index 5da7ea7032cbe350347717d30933c03be7944449..0000000000000000000000000000000000000000 --- a/config/custom-environment-variables.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { NODE_ENV: 'NODE_ENV' } \ No newline at end of file diff --git a/src/setup-db/generate-env.js b/src/setup-db/generate-env.js index cc1d571d3a12759345e8aff2c0883063c8b61b32..5f1572238e2ff27a5a288666fc5138a98b9aa437 100644 --- a/src/setup-db/generate-env.js +++ b/src/setup-db/generate-env.js @@ -3,9 +3,10 @@ const fs = require('fs-extra') const crypto = require('crypto') const logger = require('@pubsweet/logger') const _ = require('lodash/fp') +const config = require('config') module.exports = () => { - const configFilePath = path.join(process.cwd(), 'config', `local-${process.env.NODE_ENV}.json`) + const configFilePath = path.join(process.cwd(), 'config', `local-${config.util.getEnv('NODE_ENV')}.json`) logger.info(`Adding pubsweet secret to ${configFilePath}`) let configObj