Skip to content
Snippets Groups Projects
Commit e50ac08e authored by Sam Galson's avatar Sam Galson
Browse files

access node_env through config.util

parent 02b77946
No related branches found
No related tags found
No related merge requests found
......@@ -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`
module.exports = { NODE_ENV: 'NODE_ENV' }
\ No newline at end of file
......@@ -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
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment