diff --git a/lib/cmd.js b/lib/cmd.js index 381ad055..781543ce 100644 --- a/lib/cmd.js +++ b/lib/cmd.js @@ -12,6 +12,8 @@ Cmd.prototype.process = function(args) { this.run(); this.blockchain(); this.simulator(); + this.test(); + this.ipfs(); this.otherCommands(); program.parse(args); }; @@ -100,6 +102,25 @@ Cmd.prototype.simulator = function() { }); }; +Cmd.prototype.test = function() { + program + .command('test') + .description('run tests') + .action(function() { + exec('mocha test/ --no-timeouts'); + }); +}; + +Cmd.prototype.ipfs = function() { + var self = this; + program + .command('ipfs') + .description('deploy to IPFS') + .action(function() { + self.Embark.ipfs(); + }); +}; + Cmd.prototype.otherCommands = function() { program .action(function(env){ diff --git a/lib/index.js b/lib/index.js index 48d0acf9..af1a6be7 100644 --- a/lib/index.js +++ b/lib/index.js @@ -22,6 +22,7 @@ var Config = require('./config.js'); var Monitor = require('./monitor.js'); var ServicesMonitor = require('./services.js'); var Console = require('./console.js'); +var IPFS = require('./ipfs.js'); var Embark = { @@ -246,6 +247,12 @@ var Embark = { initTests: function(options) { return new Test(options); + }, + + // TODO: should deploy if it hasn't already + ipfs: function() { + var ipfs = new IPFS({buildDir: 'dist/'}); + ipfs.deploy(); } };