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