Skip to content

Commit

Permalink
Add bin executable statement
Browse files Browse the repository at this point in the history
  • Loading branch information
jessedobbelaere committed Oct 18, 2017
1 parent abf9d5c commit 7c66fa6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,25 @@
[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)
[![Downloads](https://img.shields.io/npm/dt/jira-smart-commit.svg)](https://www.npmjs.com/package/jira-smart-commit)

A Node.js git hook script to prefix commits automatically with the JIRA ticket, based on a branch name.
A Node.js git hook script to prefix commits automatically with the JIRA ticket, based on a branch name.

## Usage

### Installation
1. Install [Husky](https://www.npmjs.com/package/husky) in your project to configure Git hooks easily
```
npm install --save-dev husky
```
2. Install this package in your project:
```
2. Install this package in your project:
```
npm install --save-dev jira-smart-commit
```
3. Configure scripts in `package.json`. The script expects his first argument to be the JIRA tag of the project.
```
"commitmsg": "jira-smart-commit SPAN"
```
4. Do your git commits like usual. If the branch was prefixed with a JIRA tag, your commit message will get prefixed with
the same tag. E.g.
the same tag.
```
Branch: TAG-411-husky-git-hooks
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jira-smart-commit",
"version": "1.0.1",
"version": "1.0.2",
"description": "A githook script that transforms commit messages to JIRA smart commits based on branch names",
"author": "Jesse Dobbelaere <[email protected]>",
"license": "MIT",
Expand All @@ -27,6 +27,9 @@
"husky",
"git hook"
],
"bin": {
"jira-smart-commit": "./index.js"
},
"dependencies": {},
"devDependencies": {
"chai": "4.1.2",
Expand Down

0 comments on commit 7c66fa6

Please sign in to comment.