Skip to content

Commit 06138d7

Browse files
committed
Add git hooks
1 parent aafaae4 commit 06138d7

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
install: .git/hooks/pre-commit
2+
install: .git/hooks/pre-push
3+
4+
.git/hooks/pre-commit: script/hook.sh
5+
cp $< $@
6+
7+
.git/hooks/pre-push: script/hook.sh
8+
cp $< $@

script/hook.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
set -ex
4+
5+
npm run jscs
6+
npm test
7+
8+
node bower.json
9+
node package.json

test/package.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ var package = require('../package');
22
var bower = require('../bower');
33
var assert = require('assert');
44

5-
describe('package', function () {
6-
it('has the same package name', function () {
5+
describe('package', function() {
6+
it('has the same package name', function() {
77
assert.equal(package.name, bower.name);
88
});
9-
it('has the same package version', function () {
9+
it('has the same package version', function() {
1010
assert.equal(package.version, bower.version);
1111
});
12-
it('requires the same version of underscore', function () {
12+
it('requires the same version of underscore', function() {
1313
assert.equal(package.devDependencies.underscore, bower.dependencies.underscore);
1414
});
1515
});

0 commit comments

Comments
 (0)