Code coverage report for lib/cli.js

Statements: 100% (14 / 14)      Branches: 100% (4 / 4)      Functions: 100% (3 / 3)      Lines: 100% (14 / 14)      Ignored: none     

All files » lib/ » cli.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 321 1 1   1 1 1     1 2 2   2           1   4             4     1
var bag = require('bagofcli');
var fs = require('fs');
var Sendman = require('./sendman');
 
function _init() {
  console.log('Creating sample configuration file: .sendman.json');
  new Sendman().init(bag.exit);
}
 
function _send(args, cb) {
  const DEFAULT_FILE = '.sendman.json';
  args = args || {};
 
  new Sendman().send(args.file || DEFAULT_FILE, bag.exit);
}
 
/**
 * Execute Sendman CLI.
 */
function exec() {
 
  var actions = {
    commands: {
      init: { action: _init },
      send: { action: _send }
    }
  };
 
  bag.command(__dirname, actions);
}
 
exports.exec = exec;