fix a bug where upload cmd used plugin name

This commit is contained in:
Jonathan Rainville 2018-04-26 14:00:41 -04:00
parent e4566f9f81
commit d046feb83d
2 changed files with 7 additions and 13 deletions

View File

@ -312,7 +312,9 @@ class Embark {
if (cmdPlugins.length > 0) {
cmdPlugin = cmdPlugins.find((pluginCmd) => {
return pluginCmd.name == platform;
return pluginCmd.uploadCmds.some(uploadCmd => {
return uploadCmd.cmd === platform;
});
});
}
if (!cmdPlugin) {

View File

@ -32,18 +32,6 @@ module.exports = function (embark) {
return "web3 = new Web3(new Web3.providers.HttpProvider('http://" + options.rpcHost + ":" + options.rpcPort + "'));";
});
/*embark.registerContractsGeneration(function (options) {
const contractGenerations = [];
Object.keys(options.contracts).map(className => {
const contract = options.contracts[className];
const abi = JSON.stringify(contract.abiDefinition);
contractGenerations.push(`${className} = new this.web3.eth.contract('${abi}').at('${contract.deployedAddress}')`);
});
return contractGenerations.join('\n');
// return '';
});*/
embark.registerConsoleCommand((cmd) => {
if (cmd === "hello") {
return "hello there!";
@ -52,4 +40,8 @@ module.exports = function (embark) {
return false;
});
embark.events.on("contractsDeployed", function() {
embark.logger.info("plugin says: your contracts have been deployed");
});
};