File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 2
2
. " $( dirname " $0 " ) /_/husky.sh"
3
3
4
4
SHORT_SHA=$( git rev-parse HEAD)
5
- LINT_LOG=" $TMPDIR " /ncu.lint." $SHORT_SHA " .log
5
+ LINT_LOG=" $TMPDIR " /lint." $SHORT_SHA " .log
6
+
7
+ # strip color
8
+ strip () {
9
+ sed -r " s/\x1B\[([0-9]{1,3}(;[0-9]{1,2};?)?)?[mGK]//g"
10
+ }
6
11
7
12
# display a notification
8
13
notify () {
@@ -26,8 +31,8 @@ notify() {
26
31
# ensure failed lint exit code passes through sed
27
32
set -o pipefail
28
33
29
- branch=$( git branch --show-current)
30
34
# Do NOT run this when rebasing or we can't get the branch
35
+ branch=$( git branch --show-current)
31
36
if [ -z " $branch " ]; then
32
37
exit 0
33
38
fi
37
42
# first error shown.
38
43
# We pipe output so that the terminal (tmux, vim, emacs etc.) isn't borked by
39
44
# stray output.
40
- npm run lint:src & > " $LINT_LOG " || notify " Lint Error" &
45
+ npm run lint:src | strip & > " $LINT_LOG " || notify " Lint Error" &
You can’t perform that action at this time.
0 commit comments