add ipfs and tests cmd

This commit is contained in:
Iuri Matias 2016-10-02 17:26:57 -04:00
parent b0458c6fab
commit fcc808b9f4
2 changed files with 28 additions and 0 deletions

View File

@ -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){

View File

@ -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();
}
};