diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-01-31 17:01:50 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-01-31 17:01:50 +0100 |
commit | a24aa79dbf5be625ec3fdac50aca955c0b478fec (patch) | |
tree | c2f9c15ae7c703d8bb1e100198108369bafb7174 /lib/config/index.js | |
parent | 633de85180b1c968edc3e884821c3de668d23506 (diff) | |
download | gitbook-a24aa79dbf5be625ec3fdac50aca955c0b478fec.zip gitbook-a24aa79dbf5be625ec3fdac50aca955c0b478fec.tar.gz gitbook-a24aa79dbf5be625ec3fdac50aca955c0b478fec.tar.bz2 |
Add base for templating
Diffstat (limited to 'lib/config/index.js')
-rw-r--r-- | lib/config/index.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/config/index.js b/lib/config/index.js index 7734392..563f03b 100644 --- a/lib/config/index.js +++ b/lib/config/index.js @@ -36,14 +36,15 @@ Config.prototype.load = function() { that.log.debug.ln('try loading configuration from', filename); return that.fs.loadAsObject(that.book.resolve(filename)) + .then(function(_config) { + that.filename = filename; + return that.replace(_config); + }) .fail(function(err) { if (err.code != 'MODULE_NOT_FOUND') throw(err); else return Promise(false); }); }) - .then(function(_config) { - return that.replace(_config); - }) .then(function() { if (!that.book.isLanguageBook()) { if (!gitbook.satisfies(that.options.gitbook)) { @@ -124,4 +125,9 @@ Config.prototype.set = function(key, value) { return _.set(this.options, key, value); }; +// Return a dump of the configuration +Config.prototype.dump = function() { + return _.cloneDeep(this.options); +}; + module.exports = Config; |