2018-04-25 17:05:58 +00:00
|
|
|
const Haml = require('haml');
|
2018-02-28 22:45:39 +00:00
|
|
|
|
2018-04-25 17:05:58 +00:00
|
|
|
module.exports = function (embark) {
|
2018-10-17 22:36:46 +00:00
|
|
|
// embark.registerServiceCheck('PluginService', function (cb) {
|
|
|
|
// cb({name: "ServiceName", status: "on"});
|
|
|
|
// });
|
2018-02-28 22:45:39 +00:00
|
|
|
|
2018-04-25 17:05:58 +00:00
|
|
|
embark.registerPipeline((embark.pluginConfig.files || ['**/*.haml']), function (opts) {
|
|
|
|
return Haml.render(opts.source);
|
2018-02-28 22:45:39 +00:00
|
|
|
});
|
2018-04-25 17:05:58 +00:00
|
|
|
|
|
|
|
embark.registerContractConfiguration({
|
|
|
|
"default": {
|
|
|
|
"contracts": {
|
|
|
|
"PluginStorage": {
|
|
|
|
"args": ["$SimpleStorage"]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
embark.addContractFile("./contracts/pluginSimpleStorage.sol");
|
2018-04-25 19:01:01 +00:00
|
|
|
|
|
|
|
embark.addFileToPipeline('./fileInPipeline.js');
|
|
|
|
embark.addFileToPipeline('./fileInPipeline.js', 'js/fileInPipeline.js');
|
|
|
|
|
2018-05-29 13:37:16 +00:00
|
|
|
embark.registerActionForEvent("deploy:contract:beforeDeploy", (params, cb) => {
|
|
|
|
embark.logger.info("applying beforeDeploy plugin...");
|
|
|
|
cb();
|
2018-04-25 19:01:01 +00:00
|
|
|
});
|
2018-04-25 20:27:47 +00:00
|
|
|
|
2018-12-14 16:43:05 +00:00
|
|
|
embark.registerConsoleCommand({
|
|
|
|
matches: ["hello"],
|
|
|
|
description: 'Says Hello',
|
|
|
|
process: (cmd, callback) => {
|
|
|
|
callback(null, 'Hello there');
|
2018-04-25 20:27:47 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2018-04-26 18:00:41 +00:00
|
|
|
embark.events.on("contractsDeployed", function() {
|
2018-06-19 18:47:50 +00:00
|
|
|
embark.logger.info("plugin says:", ' your contracts have been deployed');
|
2018-04-26 18:00:41 +00:00
|
|
|
});
|
|
|
|
|
2017-03-16 11:31:52 +00:00
|
|
|
};
|