2014-10-09 21:59:09 +02:00
|
|
|
module.exports = function (grunt) {
|
|
|
|
var Promise = require('bluebird');
|
|
|
|
var spawn = require('./utils/spawn');
|
|
|
|
|
|
|
|
grunt.registerTask('get_build_props', function () {
|
|
|
|
Promise.props({
|
2014-12-17 08:22:36 +01:00
|
|
|
sha: spawn.silent('git', ['rev-parse', 'HEAD'])(),
|
2014-10-09 21:59:09 +02:00
|
|
|
num: spawn.silent('sh', ['-c', 'git log --format="%h" | wc -l'])()
|
|
|
|
})
|
|
|
|
.then(function (props) {
|
|
|
|
grunt.config.set('commitSha', props.sha.trim());
|
|
|
|
grunt.config.set('buildNum', props.num.trim());
|
|
|
|
})
|
|
|
|
.nodeify(this.async());
|
|
|
|
});
|
2014-12-17 08:22:36 +01:00
|
|
|
};
|