Created
December 12, 2014 15:22
-
-
Save ahmednuaman/592405f8a0b9ac561306 to your computer and use it in GitHub Desktop.
Grunt githash grabber
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// use like <%= commitsha1 %> | |
grunt.registerTask('githash', function () { | |
var done = this.async(), | |
config; | |
config = { | |
cmd: 'git', | |
args: ['rev-parse', '--verify', 'HEAD'] | |
}; | |
grunt.util.spawn(config, function (err, result) { | |
grunt.config('commitsha1', result.stdout); | |
grunt.log.ok('Setting `commitsha1` to ' + result.stdout); | |
done(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment