fix function identation

This commit is contained in:
Iuri Matias 2018-02-28 18:14:41 -05:00
parent 5ee99a1e5a
commit 3c1156fc64

View File

@ -29,14 +29,14 @@ class Pipeline {
self.buildWeb3JS(function() {
// limit:1 due to issues when downloading required files such as web3.js
async.eachOfLimit(self.assetFiles, 1, function (files, targetFile, cb) {
// limit:1 due to issues when downloading required files such as web3.js
async.mapLimit(files, 1,
function(file, fileCb) {
self.logger.trace("reading " + file.filename);
async.eachOfLimit(self.assetFiles, 1, function (files, targetFile, cb) {
// limit:1 due to issues when downloading required files such as web3.js
async.mapLimit(files, 1,
function(file, fileCb) {
self.logger.trace("reading " + file.filename);
if (file.filename.indexOf('.js') >= 0) {
if (file.filename.indexOf('.js') >= 0) {
let importsList = {};
//importsList["Embark/EmbarkJS"] = fs.embarkPath("js/embark.js");
@ -113,53 +113,53 @@ class Pipeline {
let fileContent = fs.readFileSync('./.embark/' + file.filename).toString();
self.runPlugins(file, fileContent, fileCb);
});
} else {
file.content(function(fileContent) {
self.runPlugins(file, fileContent, fileCb);
});
}
},
function (err, contentFiles) {
if (err) {
self.logger.warn('errors found while generating ' + targetFile);
}
let dir = targetFile.split('/').slice(0, -1).join('/');
self.logger.trace("creating dir " + self.buildDir + dir);
fs.mkdirpSync(self.buildDir + dir);
// if it's a directory
if (targetFile.slice(-1) === '/' || targetFile.indexOf('.') === -1) {
let targetDir = targetFile;
if (targetDir.slice(-1) !== '/') {
targetDir = targetDir + '/';
} else {
file.content(function(fileContent) {
self.runPlugins(file, fileContent, fileCb);
});
}
},
function (err, contentFiles) {
if (err) {
self.logger.warn('errors found while generating ' + targetFile);
}
let dir = targetFile.split('/').slice(0, -1).join('/');
self.logger.trace("creating dir " + self.buildDir + dir);
fs.mkdirpSync(self.buildDir + dir);
contentFiles.map(function (file) {
let filename = file.filename.replace(file.basedir + '/', '');
self.logger.info("writing file " + (self.buildDir + targetDir + filename).bold.dim);
// if it's a directory
if (targetFile.slice(-1) === '/' || targetFile.indexOf('.') === -1) {
let targetDir = targetFile;
fs.copySync(file.path, self.buildDir + targetDir + filename, {overwrite: true});
});
} else {
let content = contentFiles.map(function (file) {
if (file === undefined) {
return "";
if (targetDir.slice(-1) !== '/') {
targetDir = targetDir + '/';
}
return file.content;
}).join("\n");
self.logger.info("writing file " + (self.buildDir + targetFile).bold.dim);
fs.writeFileSync(self.buildDir + targetFile, content);
contentFiles.map(function (file) {
let filename = file.filename.replace(file.basedir + '/', '');
self.logger.info("writing file " + (self.buildDir + targetDir + filename).bold.dim);
fs.copySync(file.path, self.buildDir + targetDir + filename, {overwrite: true});
});
} else {
let content = contentFiles.map(function (file) {
if (file === undefined) {
return "";
}
return file.content;
}).join("\n");
self.logger.info("writing file " + (self.buildDir + targetFile).bold.dim);
fs.writeFileSync(self.buildDir + targetFile, content);
}
cb();
}
cb();
}
);
},
function (_err, _results) {
callback();
);
},
function (_err, _results) {
callback();
});
});
});
}
runPlugins(file, fileContent, fileCb) {