mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-05 10:23:25 +00:00
fix function identation
This commit is contained in:
parent
5ee99a1e5a
commit
3c1156fc64
@ -29,14 +29,14 @@ class Pipeline {
|
|||||||
|
|
||||||
self.buildWeb3JS(function() {
|
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
|
// limit:1 due to issues when downloading required files such as web3.js
|
||||||
async.mapLimit(files, 1,
|
async.eachOfLimit(self.assetFiles, 1, function (files, targetFile, cb) {
|
||||||
function(file, fileCb) {
|
// limit:1 due to issues when downloading required files such as web3.js
|
||||||
self.logger.trace("reading " + file.filename);
|
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 = {};
|
let importsList = {};
|
||||||
|
|
||||||
//importsList["Embark/EmbarkJS"] = fs.embarkPath("js/embark.js");
|
//importsList["Embark/EmbarkJS"] = fs.embarkPath("js/embark.js");
|
||||||
@ -113,53 +113,53 @@ class Pipeline {
|
|||||||
let fileContent = fs.readFileSync('./.embark/' + file.filename).toString();
|
let fileContent = fs.readFileSync('./.embark/' + file.filename).toString();
|
||||||
self.runPlugins(file, fileContent, fileCb);
|
self.runPlugins(file, fileContent, fileCb);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
file.content(function(fileContent) {
|
file.content(function(fileContent) {
|
||||||
self.runPlugins(file, fileContent, fileCb);
|
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 + '/';
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
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) {
|
// if it's a directory
|
||||||
let filename = file.filename.replace(file.basedir + '/', '');
|
if (targetFile.slice(-1) === '/' || targetFile.indexOf('.') === -1) {
|
||||||
self.logger.info("writing file " + (self.buildDir + targetDir + filename).bold.dim);
|
let targetDir = targetFile;
|
||||||
|
|
||||||
fs.copySync(file.path, self.buildDir + targetDir + filename, {overwrite: true});
|
if (targetDir.slice(-1) !== '/') {
|
||||||
});
|
targetDir = targetDir + '/';
|
||||||
} 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);
|
contentFiles.map(function (file) {
|
||||||
fs.writeFileSync(self.buildDir + targetFile, content);
|
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) {
|
runPlugins(file, fileContent, fileCb) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user