Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.

Commit 5769b5c

Browse files
committedAug 24, 2019
make local validation optional
1 parent 24e1be9 commit 5769b5c

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed
 

‎.huskyrc.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
const tasks = arr => arr.join(' && ')
2-
32
module.exports = {
43
'hooks': {
54
'pre-commit': tasks([
65
'exec < /dev/tty',
7-
`if ! eMSG=$(circleci config validate -c .circleci/config.yml); then
8-
echo "CircleCI Configuration Failed Validation."
9-
echo $eMSG
10-
exit 1
11-
fi`
6+
`if ! [ -x "$(command -v circleci)" ]; then
7+
echo "If you want to verify your circleci config precommit, please install
8+
the local circleci tool from https://circleci.com/docs/2.0/local-cli/"; else
9+
if ! eMSG=$(circleci config validate -c .circleci/config.yml); then
10+
echo "CircleCI Configuration Failed Validation."
11+
echo $eMSG
12+
exit 1
13+
fi
14+
fi`
1215
])
1316
}
1417
}

0 commit comments

Comments
 (0)
This repository has been archived.