Skip to content

Commit c731d6d

Browse files
author
zdk
committed
Fix git pre-commit script and relevant style
1 parent e01ba4e commit c731d6d

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

blah.js

Whitespace-only changes.

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
var omiseResources = require('./lib/apiResources.js');
44
module.exports = function(config) {
55
return omiseResources(config);
6-
};
6+
};

lib/apiResources.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@ function omiseResources(config) {
1212
customers: resourceName('Customer')
1313
}
1414
}
15-
16-
module.exports = omiseResources;
15+
module.exports = omiseResources;

pre-commit.sh

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
1+
#!/bin/sh
12
git stash -q --keep-index
3+
4+
#check code styling
25
npm run jscs
6+
RESULT=$?
7+
git stash pop -q
8+
if [ $RESULT -ne 0 ];
9+
then
10+
echo "Inconsistent style, commit has failed."
11+
exit 1
12+
fi
13+
#run test
314
npm test
415
RESULT=$?
516
git stash pop -q
6-
[ $RESULT -ne 0 ] && exit 1
17+
if [ $RESULT -ne 0 ];
18+
then
19+
echo "Test failed, commit has failed."
20+
exit 1
21+
fi
722
exit 0

0 commit comments

Comments
 (0)