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

44 lines
1.1 KiB
JavaScript
Raw Normal View History

const Haml = require('haml');
2018-02-28 22:45:39 +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
embark.registerPipeline((embark.pluginConfig.files || ['**/*.haml']), function (opts) {
return Haml.render(opts.source);
2018-02-28 22:45:39 +00:00
});
embark.registerContractConfiguration({
"default": {
"contracts": {
"PluginStorage": {
"args": ["$SimpleStorage"]
}
}
}
});
embark.addContractFile("./contracts/pluginSimpleStorage.sol");
embark.addFileToPipeline('./fileInPipeline.js');
embark.addFileToPipeline('./fileInPipeline.js', 'js/fileInPipeline.js');
embark.registerActionForEvent("deploy:contract:beforeDeploy", (params, cb) => {
embark.logger.info("applying beforeDeploy plugin...");
cb();
});
embark.registerConsoleCommand((cmd) => {
if (cmd === "hello") {
return "hello there!";
}
// continue to embark or next plugin;
return false;
});
embark.events.on("contractsDeployed", function() {
2018-06-19 18:47:50 +00:00
embark.logger.info("plugin says:", ' your contracts have been deployed');
});
};