diff --git a/package.json b/package.json index 868a4d3d0..bbad512c4 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "coverage": "scripts/checks/coverage.sh", "docs": "npm run prepare-docs && oz-docs", "docs:watch": "oz-docs watch contracts docs/templates docs/config.js", - "prepare": "git config --local core.hooksPath .githooks", + "prepare": "scripts/prepare.sh", "prepare-docs": "scripts/prepare-docs.sh", "lint": "npm run lint:js && npm run lint:sol", "lint:fix": "npm run lint:js:fix && npm run lint:sol:fix", diff --git a/scripts/prepare.sh b/scripts/prepare.sh new file mode 100755 index 000000000..a7d74227d --- /dev/null +++ b/scripts/prepare.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -euo pipefail + +if git status &>/dev/null; then git config core.hooksPath .githooks; fi