Skip to content

Commit

Permalink
Updated Badges
Browse files Browse the repository at this point in the history
  • Loading branch information
franz-josef-kaiser committed Jul 31, 2014
1 parent b033305 commit 96ab355
Showing 1 changed file with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# grunt-githooks

[![Build Status](https://travis-ci.org/rhumaric/grunt-githooks.png?branch=master)](https://travis-ci.org/rhumaric/grunt-githooks)
[![Code Climate](https://codeclimate.com/github/rhumaric/grunt-githooks.png)](https://codeclimate.com/github/rhumaric/grunt-githooks)
[![Build Status](https://travis-ci.org/wecodemore/grunt-githooks.png?branch=master)](https://travis-ci.org/wecodemore/grunt-githooks)
[![Code Climate](https://codeclimate.com/github/wecodemore/grunt-githooks.png)](https://codeclimate.com/github/wecodemore/grunt-githooks)

> A Grunt plugin to help bind Grunt tasks to Git hooks
Expand Down Expand Up @@ -43,9 +43,9 @@ grunt.initConfig({

#### Defining a few hooks

Hooks are listed as keys of your target configuration.
**Any key other than `option`** is considered the name of a hook you want to create.
The simplest way to define a hook is to provide a **space-separated list of the tasks you want the hook to run as the value**.
Hooks are listed as keys of your target configuration.
**Any key other than `option`** is considered the name of a hook you want to create.
The simplest way to define a hook is to provide a **space-separated list of the tasks you want the hook to run as the value**.

For example:
```js
Expand All @@ -64,8 +64,8 @@ It will still create the hook, though, in case Git introduces new hooks in the f

#### Hook specific options

If you need to override a few options for a given hook only, you can *use and Object instead of a String*.
The `taskNames` property will then correspond to the tasks you want to run.
If you need to override a few options for a given hook only, you can *use and Object instead of a String*.
The `taskNames` property will then correspond to the tasks you want to run.
Any other key will be merged into the options.

```js
Expand All @@ -75,7 +75,7 @@ grunt.initConfig({
options: {
template: 'path/to/a/template'
},
// Will bind the jshint and test:unit tasks
// Will bind the jshint and test:unit tasks
// with the template specified above
'pre-commit': 'jshint test:unit',

Expand All @@ -92,7 +92,7 @@ grunt.initConfig({

#### Working with existing hooks

If you happen to have existing hooks in your hook folder, the plugin *appends the code launching Grunt* at the end of your hooks.
If you happen to have existing hooks in your hook folder, the plugin *appends the code launching Grunt* at the end of your hooks.
You can also insert marker comments in your hooks to specify exactly where you want them inserted.
Your existing hook would look something like this:

Expand All @@ -108,9 +108,9 @@ The markers get automatically inserted when the plugin appends code, so hooks ge

#### Customising hook output

By default, the plugin generate NodeJS scripts for the hooks.
By default, the plugin generate NodeJS scripts for the hooks.
Reasonning behind this is that creating Shell scripts won't work well for people using Windows.
Plus, NodeJS is already installed as Grunt kinda needs it.
Plus, NodeJS is already installed as Grunt kinda needs it.
However, you're not tied to it and you can customise the generated script entirely. In case of a Shell script:

```js
Expand Down Expand Up @@ -142,8 +142,8 @@ In the template, you've got access to the following variables:

#### Extending the plugin

Pretty annoying when you're using a library that's missing the exact extension point you need to tweak its functionalities?
`grunt-githooks` is based on a lot of small functions and most of them are exposed so you can override them.
Pretty annoying when you're using a library that's missing the exact extension point you need to tweak its functionalities?
`grunt-githooks` is based on a lot of small functions and most of them are exposed so you can override them.
If you need feel, free to tinker with the internals (at your own risk though ;)). Could be something along:

```js
Expand Down Expand Up @@ -188,7 +188,7 @@ code in it (to avoid inserting Node code in a Python hook for example).
Type: `String`

Path to the Handlebars template used to generate the code that will run Grunt
in the hook. Default template is the `node.js.hb` file located in the `templates` folder of the plugin.
in the hook. Default template is the `node.js.hb` file located in the `templates` folder of the plugin.
It also contains a `shell.hb` file with the template for a shell script hook.

> **Note**: Handlebars escapes HTML special characters if you use only two curly braces to insert
Expand All @@ -203,22 +203,22 @@ Default: `'// GRUNT-GITHOOKS START'`
Type: `String`
Default: `'// GRUNT-GITHOOKS END'`

`startMarker` and `endMarker` are markers the plugin use to know where to insert code if a hook already exist.
`startMarker` and `endMarker` are markers the plugin use to know where to insert code if a hook already exist.
If the existing hook doesn't have these markers, the code will simply be appended.

#### preventExit
Type: `Boolean`
Default `false`

By default, the inserted code will exit the process after Grunt has run, using a -1 exit code if the task(s) failed.
By default, the inserted code will exit the process after Grunt has run, using a -1 exit code if the task(s) failed.
If you're inserting the code running Grunt in the middle of an existing hook,
you might want to disable this so any code after what was inserted by the plugin runs.

#### dest
Type: `String`
Default value: `'.git/hooks'`

This option allows you to choose in which directory the hooks should be generated.
This option allows you to choose in which directory the hooks should be generated.
Comes in handy if your Gruntfile is not at the root of your Git project.


Expand All @@ -228,12 +228,9 @@ In lieu of a formal styleguide, take care to maintain the existing coding style.


## Release History

- 2013-12-17 v0.3.1 [Escaping fix in the hooks templates](https://github.com/rhumaric/grunt-githooks/pull/15) by @gyoshev.

- 2014-07-30 v0.3.2 Moved from @rhumaric to @wecodemore, updated default Nodejs template, updated badges
- 2013-12-17 v0.3.1 [Escaping fix in the hooks templates](https://github.com/wecodemore/grunt-githooks/pull/15) by @gyoshev.
- 2013-11-13 v0.3.0 New *command* option to specify which command to run, in case full path to Grunt is needed. NodeJS template now uses new `escapeBackslashes` helper to make sure backslashes ('\') are properly escaped when written in the hook
- 2013-10-05 v0.2.0 New *args* option to specify arguments to hooked task. Bugfix to allow running grunt when the Gruntfile is not at the root of the project.
- 2013-09-02 v0.1.0 Initial functionnalities


[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rhumaric/grunt-githooks/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

- 2013-09-02 v0.1.0 Initial functionalities

0 comments on commit 96ab355

Please sign in to comment.