|
@@ -32,7 +32,6 @@ exports.produceConfigObject = function (root, callback) {
|
|
|
dirExists[path.basename(dirs[i])] = true;
|
|
|
}
|
|
|
|
|
|
- var result;
|
|
|
var files = Object.keys(filesAndDirs.files);
|
|
|
var firstPass = [], secondPass = [];
|
|
|
for (var i = 0; i < files.length; i++) {
|
|
@@ -51,15 +50,15 @@ exports.produceConfigObject = function (root, callback) {
|
|
|
}
|
|
|
}
|
|
|
var bothPasses = [].concat(firstPass).concat(secondPass);
|
|
|
+ if (!bothPasses.length) {
|
|
|
+ callback(new Error("No .amd.json-type file found"));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var result = {};
|
|
|
for (var i = 0; i < bothPasses.length; i++) {
|
|
|
var file = bothPasses[i];
|
|
|
- result = result || {};
|
|
|
_.merge(result, require(file));
|
|
|
}
|
|
|
- if (!result) {
|
|
|
- callback(new Error("local.amd.json not found"));
|
|
|
- } else {
|
|
|
- callback(null, result);
|
|
|
- }
|
|
|
+ callback(null, result);
|
|
|
})
|
|
|
};
|