#!/bin/bash
docker-compose run --rm web sh ./node_modules/pre-commit/hook # web is my docker-compose service name
RESULT=$?
[ $RESULT -ne 0 ] && exit 1
exit 0
Is there a way to customize pre-commit script in configuration or something? (rather than manual change)
Hi, I want to run pre-commit hook in my docker container as I moved my dev environment to the docker.
By default, pre-commit requires
npm install
in local environment to run./node_modules/pre-commit/hook
in .git/hooks/pre-commit script.When I did some research, I found this link https://spectrum.chat/node/general/pre-commit-with-docker~840290ba-1cb6-40e2-a7ad-7566054638b8. I changed the first line of the pre-commit script manually as below and it worked as expected although it's quite slow.
Is there a way to customize pre-commit script in configuration or something? (rather than manual change)
Thanks