imdone-core
Advanced tools
Comparing version 1.2.4 to 1.2.5
{ | ||
"exclude": [ | ||
"^(node_modules|bower_components|\\.imdone|target|build|dist)[\\/\\\\]?|\\.(git|svn|hg|npmignore)|\\~$|\\.(jpg|png|gif|swp|ttf|otf)$", | ||
"^test\\/" | ||
"^test\\/", | ||
"^(node_modules|bower_components|\\.imdone|target|build|dist|logs)[\\/\\\\]?|\\.(git|svn|hg|npmignore)|\\~$|\\.(jpg|png|gif|swp|ttf|otf)$" | ||
], | ||
@@ -6,0 +7,0 @@ "watcher": true, |
@@ -50,2 +50,3 @@ 'use strict'; | ||
repo.emit('initialized', {ok:true}); | ||
repo.saveConfig(); | ||
if (err) repo.emit('error', err); | ||
@@ -119,16 +120,15 @@ cb(err, files); | ||
var baseConfig = _.cloneDeep(constants.DEFAULT_CONFIG); | ||
if (repo.config) { | ||
cb(null, new Config(_.defaults(repo.config, baseConfig))); | ||
} else { | ||
var file = repo.getFullPath(CONFIG_FILE); | ||
fs.exists(file, function(exists) { | ||
if (exists) { | ||
fs.readFile(file, function(err, data) { | ||
if (err) return cb(err); | ||
var configLike = JSON.parse(data.toString()); | ||
cb(null, new Config(_.defaults(configLike, baseConfig))); | ||
}); | ||
} else cb(null, new Config(baseConfig)); | ||
}); | ||
} | ||
if (repo.config) baseConfig = _.defaults(repo.config, baseConfig); | ||
var file = repo.getFullPath(CONFIG_FILE); | ||
fs.exists(file, function(exists) { | ||
if (exists) { | ||
fs.readFile(file, function(err, data) { | ||
if (err) return cb(err); | ||
var configLike = JSON.parse(data.toString()); | ||
// Merge the exclude | ||
configLike.exclude = _.uniq(configLike.exclude.concat(baseConfig.exclude)); | ||
cb(null, new Config(_.defaults(configLike, baseConfig))); | ||
}); | ||
} else cb(null, new Config(baseConfig)); | ||
}); | ||
}; | ||
@@ -135,0 +135,0 @@ |
{ | ||
"name": "imdone-core", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "imdone-core", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
141592
4210