File tree 4 files changed +16
-3
lines changed
4 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 40
40
"postversion" : " git push && git push --tags && npm publish --tag next" ,
41
41
"prepublish" : " pinst --disable" ,
42
42
"postpublish" : " pinst --enable" ,
43
- "pretest" : " npm run build && npm pack" ,
43
+ "pretest" : " npm run build --silent && npm pack --silent " ,
44
44
"test" : " sh ./test/default.sh && sh ./test/subdir.sh" ,
45
45
"posttest" : " rm husky-*.tgz" ,
46
46
"commit" : " commit"
Original file line number Diff line number Diff line change 1
1
# Exit on error
2
2
set -eu
3
3
4
+ function title {
5
+ echo
6
+ echo " -------------------"
7
+ echo " + $1 "
8
+ echo " -------------------"
9
+ echo
10
+ }
11
+
4
12
# Create $1 and install tgz
5
13
function install_tgz {
14
+ # generated by pretest script
6
15
tgz=" ./husky-*.tgz"
7
16
8
17
# Create directory
Original file line number Diff line number Diff line change 1
1
. $( dirname $0 ) /_functions.sh
2
2
3
+ title " default"
4
+
3
5
tempDir=/tmp/pre-commit-test
4
6
5
7
rm -rf $tempDir
@@ -21,4 +23,4 @@ npx --no-install husky add pre-commit "echo \"msg from pre-commit hook\" && exit
21
23
22
24
# Test pre-commit
23
25
git add package.json
24
- git commit -m " should fail" || echo -e " \e[0;32msuccess :) \e[m" && exit 0
26
+ git commit -m " should fail" || echo -e " \e[0;32mSUCCESS \e[m" && exit 0
Original file line number Diff line number Diff line change 1
1
. $( dirname $0 ) /_functions.sh
2
2
3
+ title " subdir"
4
+
3
5
rootDir=" /tmp/pre-commit-sub"
4
6
subDir=" $rootDir /sub"
5
7
@@ -31,4 +33,4 @@ npx --no-install husky add pre-commit "echo \"msg from pre-commit hook\" && exit
31
33
32
34
# Test pre-commit
33
35
git add package.json
34
- git commit -m " should fail" || echo -e " \e[0;32msuccess :) \e[m" && exit 0
36
+ git commit -m " should fail" || echo -e " \e[0;32mSUCCESS \e[m" && exit 0
You can’t perform that action at this time.
0 commit comments