function parseConfigDirJson (scriptsPath, dir) {
    var editedJson;
    return new Promise(function (resolve, reject) {
        gulp.src(configSourceFiles.map(function (i) { return join(scriptsPath, dir, i); }))
            .pipe(jsonminify()) // remove any comments which would break the merging
            .pipe(merge({       // merge default and custom (if it exists) into combined.json
                fileName: configMergedSources
            }))
            .pipe(merge({       // add filename as key for the whole json
                fileName: configMergedSources,
                edit: function (parsedJson, file) {
                    editedJson = {};
                    editedJson[dir] = parsedJson;
                    return editedJson;
                }
            }))
            .on('error', reject)
            .on('end', function () {
                resolve(editedJson);
            });
    });
}
/*
 * Merge and parse json files in the specified directory and return the processed json (promise)
 */
Merge and parse json files in the specified directory and return the processed json (promise)
Merge and parse json files in the specified directory and return the processed json ( promise )
function parseConfigDirJson (scriptsPath, dir) {
    var editedJson;
    return new Promise(function (resolve, reject) {
        gulp.src(configSourceFiles.map(function (i) { return join(scriptsPath, dir, i); }))
            .pipe(jsonminify()) 
            .pipe(merge({       
                fileName: configMergedSources
            }))
            .pipe(merge({       
                fileName: configMergedSources,
                edit: function (parsedJson, file) {
                    editedJson = {};
                    editedJson[dir] = parsedJson;
                    return editedJson;
                }
            }))
            .on('error', reject)
            .on('end', function () {
                resolve(editedJson);
            });
    });
}
function parseConfigDirJson ( scriptsPath , dir ) { var editedJson ; return new Promise ( function ( resolve , reject ) { gulp . src ( configSourceFiles . map ( function ( i ) { return join ( scriptsPath , dir , i ) ; } ) ) . pipe ( jsonminify ( ) ) . pipe ( merge ( { fileName : configMergedSources } ) ) . pipe ( merge ( { fileName : configMergedSources , edit : function ( parsedJson , file ) { editedJson = { } ; editedJson [ dir ] = parsedJson ; return editedJson ; } } ) ) . on ( 'error' , reject ) . on ( 'end' , function ( ) { resolve ( editedJson ) ; } ) ; } ) ; }
Merge and parse json files in the specified directory and return the processed json (promise)
Merge and parse json files in the specified directory and return the processed json ( promise )
// remove any comments which would break the merging // merge default and custom (if it exists) into combined.json // add filename as key for the whole json