addFileToPipeline test and registerBeforeDeploy with new arg

This commit is contained in:
Jonathan Rainville 2018-04-25 15:01:01 -04:00
parent c818326f2e
commit 61be2c7bd7
5 changed files with 17 additions and 8 deletions

View File

@ -280,17 +280,17 @@ class Deploy {
// calling each beforeDeploy handler declared by the plugin
async.eachSeries(plugin.beforeDeploy, (beforeDeployFn, eachCb) => {
function beforeDeployCb(resObj){
contract.code = resObj.contractCode;
eachCb();
}
beforeDeployFn({
embarkDeploy: self,
pluginConfig: plugin.pluginConfig,
deploymentAccount: deploymentAccount,
contract: contract,
callback:
(function(resObj){
contract.code = resObj.contractCode;
eachCb();
})
});
callback: beforeDeployCb
}, beforeDeployCb);
}, () => {
//self.logger.info('All beforeDeploy handlers of the plugin has processed.');
eachPluginCb();

View File

@ -286,7 +286,7 @@ Config.prototype.loadFiles = function(files) {
}
});
filesFromPlugins.filter(function(file) {
if (utils.fileMatchesPattern(files, file.intendedPath)) {
if ((file.intendedPath && utils.fileMatchesPattern(files, file.intendedPath)) || utils.fileMatchesPattern(files, file.file)) {
readFiles.push(file);
}
});

View File

@ -0,0 +1 @@
console.log('File added to the pipeline using embark.addFileToPipeline');

View File

@ -19,4 +19,12 @@ module.exports = function (embark) {
}
});
embark.addContractFile("./contracts/pluginSimpleStorage.sol");
embark.addFileToPipeline('./fileInPipeline.js');
embark.addFileToPipeline('./fileInPipeline.js', 'js/fileInPipeline.js');
embark.registerBeforeDeploy(function(options, callback) {
// Just calling register to prove it works. We don't actually want to change the contracts
callback({contractCode: options.contract.code});
});
};

View File

@ -14,7 +14,7 @@
},
"dependencies": {
"bootstrap": "^3.3.6",
"embark-service": "./extensions/embark-service",
"embark-service": "file:extensions/embark-service",
"jquery": "^1.11.3",
"react": "^16.0.0",
"react-bootstrap": "^0.32.0",