Code coverage report for tasks/bump.js

Statements: 91.67% (22 / 24)      Branches: 83.33% (10 / 12)      Functions: 80% (4 / 5)      Lines: 95.45% (21 / 22)      Ignored: none     

All files » tasks/ » bump.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 311 1 1 1 1   1 4 4 4 4   4 3 3       1 4 4   4 4 4     1 4    
var Promise = require('es6-promise').Promise;
var extend = require('util')._extend;
var log = require('./utils/log');
var helper = require('./utils/config-helper');
var config;
 
function bump(location, options){
    var build = require('./build');
    var Bump = require('./utils/bump');
    var filesToBump = location || config.tasks.bump;
    return new Bump(filesToBump, options).run()
        .then(function(version){
            if (!version) return;
            log.info(" * Now on " + version);
            return version;
        }).catch(log.onError);
}
 
function exec(subtask, location, options){
    config = helper.getConfig();
    Iif (!config.tasks.bump && !location) return Promise.resolve();
 
    options = extend(config.bump || {}, options || {});
    log.info('Bumping :');
    return bump(location, options);
}
 
module.exports = {
    all:  function(location, options){ return exec('all', location, options); },
    adhoc:  function(location, options){ return exec('all', location, options); }
};