File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -eu
4+
5+ function timed_run() {
6+ description=$1
7+ command=$2
8+ timer=$( date +%s)
9+
10+ $command
11+ exit_code=$?
12+ timer=$(( $(date +% s) - timer))
13+
14+ verbose=${MM_VERBOSE_HOOKS:- 0}
15+
16+ if [ " $verbose " == " 1" ]; then
17+ echo " ℹ️ $description - $timer seconds"
18+ echo " exit code: $exit_code "
19+ fi
20+
21+ if [ $exit_code -ne 0 ]; then
22+ echo " ℹ️ $description - failed"
23+ exit $exit_code
24+ fi
25+ }
26+
27+ timed_run " local/precious lint" " local/precious lint --staged"
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ chmod +x git/hooks/*
4+ cd .git/hooks || exit
5+ rm -f pre-commit.sample
6+ ln -s ../../git/hooks/pre-commit .
7+ git config --local core.hooksPath .git/hooks
You can’t perform that action at this time.
0 commit comments