grunt-git-rev-parse
A git tool for grunt Get git commit id
Getting Started
This plugin requires Grunt~0.4.0
First of all, you need to install this plugin by npm,
npm install grunt-git-rev-parse --save-dev
And second, you need to load this task in your grunt file.
grunt.loadNpmTasks('grunt-git-rev-parse');
The "git-rev-parse" task
Overview
In your project's Gruntfile, add a section namedgit-rev-parse
to the data object passed into grunt.initConfig()
.grunt.initConfig({
"git-rev-parse": {
"options": {
// Task-specific options go here.
}
},
})
Options
options.prop
Type:String
Default value:
''
A string value that is used as a property name for storing the result of this task
options.number
Type:Number
Default value:
6
The number of SHA1 value. Under the hood, this is the 'number' of git command
--short=[number]
options.silent
Type:Boolean
Default value:
false
If true the task will not print the result on success. Error-messages will still be printed.
Inspired by Mikael Karon grunt-git-describe