summaryrefslogtreecommitdiffstats
path: root/lib/config/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/config/index.js')
-rw-r--r--lib/config/index.js12
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;