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

[GH-47] add more flexibility to config file path #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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