mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-23 04:28:19 +00:00
make file changes in the pipelins
This commit is contained in:
parent
1f6e386d9b
commit
7271b00cf4
@ -353,15 +353,7 @@ class CodeGenerator {
|
||||
code += "\nglobal.__embarkContext = __mainContext.__loadManagerInstance;\n";
|
||||
code += "\nwindow.web3 = web3;\n";
|
||||
code += "\nexport default web3;\n";
|
||||
next();
|
||||
},
|
||||
function makeDirectory(next) {
|
||||
fs.mkdirp(fs.dappPath(".embark"), (err, _result) => {
|
||||
next(err);
|
||||
});
|
||||
},
|
||||
function writeFile(next) {
|
||||
fs.writeFile(fs.dappPath(".embark", 'web3_instance.js'), code, next);
|
||||
next(null, code);
|
||||
}
|
||||
], cb);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ class Pipeline {
|
||||
self.buildContracts(contractsJSON, next);
|
||||
},
|
||||
function buildWeb3(next) {
|
||||
self.events.request('code-generator:web3js', next);
|
||||
self.buildWeb3JS(next);
|
||||
},
|
||||
function createImportList(next) {
|
||||
importsList["Embark/EmbarkJS"] = fs.dappPath(".embark", 'embark.js');
|
||||
@ -211,6 +211,23 @@ class Pipeline {
|
||||
});
|
||||
}
|
||||
|
||||
buildWeb3JS(cb) {
|
||||
const self = this;
|
||||
async.waterfall([
|
||||
function getWeb3Code(next) {
|
||||
self.events.request('code-generator:web3js', next);
|
||||
},
|
||||
function makeDirectory(code, next) {
|
||||
fs.mkdirp(fs.dappPath(".embark"), (err, _result) => {
|
||||
next(err, code);
|
||||
});
|
||||
},
|
||||
function writeFile(code, next) {
|
||||
fs.writeFile(fs.dappPath(".embark", 'web3_instance.js'), code, next);
|
||||
}
|
||||
], cb);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = Pipeline;
|
||||
|
Loading…
x
Reference in New Issue
Block a user