emizzle cc30ff390e Implemented PR review changes
* Removed config init from `cmd.js` for upload.
* refactored `upload()` to use engine services instead of loading and using plugins directly.
* now passing web3 directly to the `Swarm` constructor
2018-04-24 10:27:11 +10:00

21 lines
416 B
JavaScript

let UploadSwarm = require('./upload.js');
class Swarm {
constructor(embark, options) {
this.logger = embark.logger;
this.upload_swarm = new UploadSwarm({
buildDir: options.buildDir || 'dist/',
storageConfig: options.storageConfig,
web3: options.web3
});
embark.registerUploadCommand('swarm', this.upload_swarm.deploy.bind(this.upload_swarm));
}
}
module.exports = Swarm;