Skip to content

Commit 805d95e

Browse files
authored
Merge pull request #613 from jaredh159/custom-dotenv-path
support custom dotenv path
2 parents 2d4e92c + aef82c3 commit 805d95e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

api.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ var log = require('db-migrate-shared').log;
55
require('pkginfo')(module, 'version'); // jshint ignore:line
66
var Promise;
77
var onComplete = load('on-complete');
8+
var config = require('rc')('db-migrate');
89

910
// constant hooks for this file
1011
var APIHooks = {
@@ -37,9 +38,12 @@ function dbmigrate (plugins, isModule, options, callback) {
3738
this.internals.dbm = require('./');
3839
this.dataType = this.internals.dbm.dataType;
3940
this.version = this.internals.dbm.version;
40-
dotenv.load({
41-
silent: true
42-
});
41+
42+
var dotenvConfig = { silent: true };
43+
if (config.dotenvCustomPath) {
44+
dotenvConfig.path = config.dotenvCustomPath;
45+
}
46+
dotenv.load(dotenvConfig);
4347

4448
/* $lab:coverage:off$ */
4549
if (!options || !options.throwUncatched) load('helper/register-events')();

0 commit comments

Comments
 (0)