Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

Commit

Permalink
add more flexbility to config file
Browse files Browse the repository at this point in the history
  • Loading branch information
fedealconada committed Jul 22, 2020
1 parent 5307ff2 commit 7298406
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ var Config = function() {
config_file = '';
// load config from defaults or config file

if (typeof process != 'undefined' && process.env.STREAM_NODE_CONFIG_DIR) {
config_file = process.env.STREAM_NODE_CONFIG_DIR + '/getstream.js';
if (typeof process != 'undefined' && process.env.STREAM_NODE_CONFIG_PATH) {
config_file = process.cwd() + process.env.STREAM_NODE_CONFIG_PATH;
} else {
config_file = process.cwd() + '/getstream.js';
}
Expand Down
5 changes: 2 additions & 3 deletions test/index_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,11 @@ describe('Config', function() {
});

describe.skip('Config Env Var', function() {
var configDir = path.join(__dirname, './tmp');
var configFile = path.join(configDir, 'getstream.js');
var configFile = '/tmp/getstream.js';

before(function() {
this.env = pmock.env({
STREAM_NODE_CONFIG_DIR: configDir,
STREAM_NODE_CONFIG_PATH: configFile,
});

mockery.enable({
Expand Down

0 comments on commit 7298406

Please sign in to comment.