File tree Expand file tree Collapse file tree 1 file changed +20
-6
lines changed
Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Original file line number Diff line number Diff line change 11#! /bin/sh
22
3- git stash -ku
3+ set -e
44
5- trap " git stash pop " EXIT
5+ export PATH= " ./node_modules/.bin: $PATH "
66
7- staged=$( git --no-pager diff --staged --name-only | grep -E ' \.js$' )
8-
9- if [ -n " $staged " ]; then
10- ./node_modules/.bin/oxlint -- ` echo $staged ` && make test
7+ if git rev-parse --verify HEAD > /dev/null 2>&1
8+ then
9+ against=HEAD
10+ else
11+ against=$( git hash-object -t tree /dev/null)
1112fi
13+
14+ git diff-index --check --cached " $against " --
15+
16+ git stash -ku --quiet
17+ trap " git stash pop --quiet" EXIT
18+
19+ changed_files=$( git diff --cached --name-only --diff-filter=ACM | grep -E ' \.(js|ts)$' ) || true
20+
21+ if [ -z " $changed_files " ]; then exit 0; fi
22+
23+ oxlint $changed_files
24+
25+ vitest run --changed
You can’t perform that action at this time.
0 commit comments