mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-21 06:25:15 -04:00
pre-commit-install: fix install of golang shfmt pre-commit hook
This commit is contained in:
parent
e00c209c6d
commit
8fcca8f885
1 changed files with 11 additions and 0 deletions
|
|
@ -12,6 +12,14 @@ if [ -z "${PYTHON}" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
GOLANG=$(command -v go || true)
|
||||
|
||||
if [ -z "${GOLANG}" ]; then
|
||||
# TODO: bootstrap go as well, maybe use https://github.com/stefanmaric/g
|
||||
echo "ERROR: did not find a 'go' executable, required for some of the pre-commit hooks"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SCRIPTDIR=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)
|
||||
|
||||
# here we assume that this script is located in the tools/ subfolder
|
||||
|
|
@ -71,6 +79,9 @@ echo "Installing pre-commit..."
|
|||
|
||||
PRE_COMMIT=$(command -v pre-commit)
|
||||
|
||||
# Enable Go 11 style modules for shfmt
|
||||
export GO111MODULE=on
|
||||
|
||||
echo "Letting pre-commit setup the rest..."
|
||||
"${PRE_COMMIT}" install --install-hooks
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue