Skip to content

Commit d046feb

Browse files
committed
fix a bug where upload cmd used plugin name
1 parent e4566f9 commit d046feb

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

lib/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,9 @@ class Embark {
312312

313313
if (cmdPlugins.length > 0) {
314314
cmdPlugin = cmdPlugins.find((pluginCmd) => {
315-
return pluginCmd.name == platform;
315+
return pluginCmd.uploadCmds.some(uploadCmd => {
316+
return uploadCmd.cmd === platform;
317+
});
316318
});
317319
}
318320
if (!cmdPlugin) {

test_apps/test_app/extensions/embark-service/index.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,6 @@ module.exports = function (embark) {
3232
return "web3 = new Web3(new Web3.providers.HttpProvider('http://" + options.rpcHost + ":" + options.rpcPort + "'));";
3333
});
3434

35-
/*embark.registerContractsGeneration(function (options) {
36-
const contractGenerations = [];
37-
Object.keys(options.contracts).map(className => {
38-
const contract = options.contracts[className];
39-
const abi = JSON.stringify(contract.abiDefinition);
40-
41-
contractGenerations.push(`${className} = new this.web3.eth.contract('${abi}').at('${contract.deployedAddress}')`);
42-
});
43-
return contractGenerations.join('\n');
44-
// return '';
45-
});*/
46-
4735
embark.registerConsoleCommand((cmd) => {
4836
if (cmd === "hello") {
4937
return "hello there!";
@@ -52,4 +40,8 @@ module.exports = function (embark) {
5240
return false;
5341
});
5442

43+
embark.events.on("contractsDeployed", function() {
44+
embark.logger.info("plugin says: your contracts have been deployed");
45+
});
46+
5547
};

0 commit comments

Comments
 (0)