Code coverage report for tasks/bump.js

Statements: 95.45% (21 / 22)      Branches: 100% (4 / 4)      Functions: 83.33% (5 / 6)      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 4 4 4 4 4   4 4 4   4       1 4 4 4 4     1 4    
var Promise = require('es6-promise').Promise;
var log = require('./utils/log');
var helper = require('./utils/config-helper');
var config, bump = {};
 
bump.all = function all(options){
    var build = require('./build');
    var Bump = require('./utils/bump');
    var newVersion;
    var filesToBump = config.tasks.bump || ['package.json','README.md', '*/app.json'];
    return new Bump(filesToBump, options).run()
        .then(function(version){
            log.info(" * Now on " + version);
            newVersion = version;
            return build.html({version:version});
        }).then(function(){
            return newVersion;
        }).catch(log.onError);
};
 
function exec(task, options){
    config = helper.getConfig();
    options = options || {};
    log.info('Bumping :');
    return bump[task](options);
}
 
module.exports = {
    all:  function(options){ return exec('all', options); },
    adhoc:  function(type){ return exec('all', { type : type }); }
};