grunt-git-info

0.0.1 • Public • Published

grunt-git-info v0.0.1

Write Git commit information into a file

Getting Started

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-git-info --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-git-info');

Configuration

This task should be configured according to the grunt Configuring tasks guide.

Parameter Description Default value
repository path to git repository root empty string
output name of the target file to be generated gitInfo.json
fields an array defining set and order of fields of output file branch, commit, short, timestamp, author, message, status

Usage Examples

All-defaults

{
  gitInfo: {}
}

Custom file name and list of fields

{
  gitInfo: {
    output: 'commit-information.json',
    fields: [
      'commit',
      'timestamp',
      'author'
    ]
  }
}

Credits

This development was inspired by these great works:

Final Notes

Licensed under terms of ISC License.

Should you have any feedback, questions, bug reports or feature requests, please file an issue.

Readme

Keywords

none

Package Sidebar

Install

npm i grunt-git-info

Weekly Downloads

6

Version

0.0.1

License

ISC

Last publish

Collaborators

  • yaruson