add ipfs and tests cmd
This commit is contained in:
parent
b0458c6fab
commit
fcc808b9f4
21
lib/cmd.js
21
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){
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue